if I try to send the registration information via :remote => true.
As far as I understand, using remote true will ensure that the form is sent with an ajax post, but once I hit submit I see that the server returns the missing template error.
I read somewhere that the registration controller is already using respond_with (I see in the code) which means that it should respond to the ajax.
Can someone clarify that or if I am missing a piece in the puzzle?
> if I try to send the registration information via :remote => true.
> As far as I understand, using remote true will ensure that the form is
> sent with an ajax post, but once I hit submit I see that the server returns
> the missing template error.
> I read somewhere that the registration controller is already using
> respond_with (I see in the code) which means that it should respond to the
> ajax.
> Can someone clarify that or if I am missing a piece in the puzzle?
>> if I try to send the registration information via :remote => true.
>> As far as I understand, using remote true will ensure that the form is >> sent with an ajax post, but once I hit submit I see that the server returns >> the missing template error.
>> I read somewhere that the registration controller is already using >> respond_with (I see in the code) which means that it should respond to the >> ajax.
>> Can someone clarify that or if I am missing a piece in the puzzle?
some common reasons why your rendered javascript won't run:
- because you may have inconsistencies with single/double-quotes or other
varieties of characters that are being treated differently in the JS from
what you're expecting, you should wrap any html you're rendering via ruby
in the escape_javascript method:
- you have a JS error, try copying the response into the browser console
and executing it to see if it runs.
- if all this is not resolving the problem, you may be using some JS
library (an example is jQuery UI Tabs) that overrules rails.js, and is
dictating that it intercepts the ajax call and renders the response. This
is more complicated to resolve, and there's no one way of solving this, but
it points you in the right direction of what to look for.
>>> if I try to send the registration information via :remote => true.
>>> As far as I understand, using remote true will ensure that the form is
>>> sent with an ajax post, but once I hit submit I see that the server returns
>>> the missing template error.
>>> I read somewhere that the registration controller is already using
>>> respond_with (I see in the code) which means that it should respond to the
>>> ajax.
>>> Can someone clarify that or if I am missing a piece in the puzzle?
On Wednesday, October 31, 2012 10:33:01 PM UTC+2, Hassan Shahid wrote:
> some common reasons why your rendered javascript won't run:
> - because you may have inconsistencies with single/double-quotes or other > varieties of characters that are being treated differently in the JS from > what you're expecting, you should wrap any html you're rendering via ruby > in the escape_javascript method:
> - you have a JS error, try copying the response into the browser console > and executing it to see if it runs.
> - if all this is not resolving the problem, you may be using some JS > library (an example is jQuery UI Tabs) that overrules rails.js, and is > dictating that it intercepts the ajax call and renders the response. This > is more complicated to resolve, and there's no one way of solving this, but > it points you in the right direction of what to look for.
> -Hassan
> On Wed, Oct 31, 2012 at 4:26 PM, israguy <guy.i...@gmail.com <javascript:> > > wrote:
>> ah good to know. I thought it should takes it from the assets directory
>> now I have a different problem.. that the actual create.js.erb is bring >> served and not run..
>> On Wednesday, October 31, 2012 6:03:52 PM UTC+2, Hassan Shahid wrote:
>>> it's looking for a create.js.[erb/haml] file under app/views/devise/** >>> registrations/
>>> Because you're asking it to respond to a JS request, it's not going to >>> render your create.html.[erb/haml] template.
>>> Lastly, a *.js.[erb/haml] is a javascript file that can execute ruby >>> code using either erb or haml, based on the extension you provide it.
>>> If you don't want to render any template, you need to tell it to render >>> nothing:
>>> def sample_method >>> respond_to do |format| >>> format.js { render :nothing => true} >>> end >>> end
>>> - Hassan
>>> On Wed, Oct 31, 2012 at 11:57 AM, israguy <guy.i...@gmail.com> wrote:
>>>> if I try to send the registration information via :remote => true.
>>>> As far as I understand, using remote true will ensure that the form is >>>> sent with an ajax post, but once I hit submit I see that the server returns >>>> the missing template error.
>>>> I read somewhere that the registration controller is already using >>>> respond_with (I see in the code) which means that it should respond to the >>>> ajax.
>>>> Can someone clarify that or if I am missing a piece in the puzzle?
On Wednesday, October 31, 2012 10:33:01 PM UTC+2, Hassan Shahid wrote:
> some common reasons why your rendered javascript won't run:
> - because you may have inconsistencies with single/double-quotes or other > varieties of characters that are being treated differently in the JS from > what you're expecting, you should wrap any html you're rendering via ruby > in the escape_javascript method:
> - you have a JS error, try copying the response into the browser console > and executing it to see if it runs.
> - if all this is not resolving the problem, you may be using some JS > library (an example is jQuery UI Tabs) that overrules rails.js, and is > dictating that it intercepts the ajax call and renders the response. This > is more complicated to resolve, and there's no one way of solving this, but > it points you in the right direction of what to look for.
> -Hassan
> On Wed, Oct 31, 2012 at 4:26 PM, israguy <guy.i...@gmail.com <javascript:> > > wrote:
>> ah good to know. I thought it should takes it from the assets directory
>> now I have a different problem.. that the actual create.js.erb is bring >> served and not run..
>> On Wednesday, October 31, 2012 6:03:52 PM UTC+2, Hassan Shahid wrote:
>>> it's looking for a create.js.[erb/haml] file under app/views/devise/** >>> registrations/
>>> Because you're asking it to respond to a JS request, it's not going to >>> render your create.html.[erb/haml] template.
>>> Lastly, a *.js.[erb/haml] is a javascript file that can execute ruby >>> code using either erb or haml, based on the extension you provide it.
>>> If you don't want to render any template, you need to tell it to render >>> nothing:
>>> def sample_method >>> respond_to do |format| >>> format.js { render :nothing => true} >>> end >>> end
>>> - Hassan
>>> On Wed, Oct 31, 2012 at 11:57 AM, israguy <guy.i...@gmail.com> wrote:
>>>> if I try to send the registration information via :remote => true.
>>>> As far as I understand, using remote true will ensure that the form is >>>> sent with an ajax post, but once I hit submit I see that the server returns >>>> the missing template error.
>>>> I read somewhere that the registration controller is already using >>>> respond_with (I see in the code) which means that it should respond to the >>>> ajax.
>>>> Can someone clarify that or if I am missing a piece in the puzzle?
On Wednesday, October 31, 2012 10:42:21 PM UTC+2, israguy wrote:
> the js seems to work if I put it in the home.js.erb (for pages#home) > and bind it to a div there
> you still helped very much!
> free hugs!
> On Wednesday, October 31, 2012 10:33:01 PM UTC+2, Hassan Shahid wrote:
>> some common reasons why your rendered javascript won't run:
>> - because you may have inconsistencies with single/double-quotes or other >> varieties of characters that are being treated differently in the JS from >> what you're expecting, you should wrap any html you're rendering via ruby >> in the escape_javascript method:
>> - you have a JS error, try copying the response into the browser console >> and executing it to see if it runs.
>> - if all this is not resolving the problem, you may be using some JS >> library (an example is jQuery UI Tabs) that overrules rails.js, and is >> dictating that it intercepts the ajax call and renders the response. This >> is more complicated to resolve, and there's no one way of solving this, but >> it points you in the right direction of what to look for.
>> -Hassan
>> On Wed, Oct 31, 2012 at 4:26 PM, israguy <guy.i...@gmail.com> wrote:
>>> ah good to know. I thought it should takes it from the assets directory
>>> now I have a different problem.. that the actual create.js.erb is bring >>> served and not run..
>>> On Wednesday, October 31, 2012 6:03:52 PM UTC+2, Hassan Shahid wrote:
>>>> it's looking for a create.js.[erb/haml] file under app/views/devise/** >>>> registrations/
>>>> Because you're asking it to respond to a JS request, it's not going to >>>> render your create.html.[erb/haml] template.
>>>> Lastly, a *.js.[erb/haml] is a javascript file that can execute ruby >>>> code using either erb or haml, based on the extension you provide it.
>>>> If you don't want to render any template, you need to tell it to render >>>> nothing:
>>>> def sample_method >>>> respond_to do |format| >>>> format.js { render :nothing => true} >>>> end >>>> end
>>>> - Hassan
>>>> On Wed, Oct 31, 2012 at 11:57 AM, israguy <guy.i...@gmail.com> wrote:
>>>>> if I try to send the registration information via :remote => true.
>>>>> As far as I understand, using remote true will ensure that the form is >>>>> sent with an ajax post, but once I hit submit I see that the server returns >>>>> the missing template error.
>>>>> I read somewhere that the registration controller is already using >>>>> respond_with (I see in the code) which means that it should respond to the >>>>> ajax.
>>>>> Can someone clarify that or if I am missing a piece in the puzzle?
On Wednesday, October 31, 2012 10:59:51 PM UTC+2, israguy wrote:
> but the create.js.erb it still being served.. so no good.
> if the file is not there it complains about missing template
> if the file is there it just serves it..
> On Wednesday, October 31, 2012 10:42:21 PM UTC+2, israguy wrote:
>> the js seems to work if I put it in the home.js.erb (for pages#home) >> and bind it to a div there
>> you still helped very much!
>> free hugs!
>> On Wednesday, October 31, 2012 10:33:01 PM UTC+2, Hassan Shahid wrote:
>>> some common reasons why your rendered javascript won't run:
>>> - because you may have inconsistencies with single/double-quotes or >>> other varieties of characters that are being treated differently in the JS >>> from what you're expecting, you should wrap any html you're rendering via >>> ruby in the escape_javascript method:
>>> - you have a JS error, try copying the response into the browser console >>> and executing it to see if it runs.
>>> - if all this is not resolving the problem, you may be using some JS >>> library (an example is jQuery UI Tabs) that overrules rails.js, and is >>> dictating that it intercepts the ajax call and renders the response. This >>> is more complicated to resolve, and there's no one way of solving this, but >>> it points you in the right direction of what to look for.
>>> -Hassan
>>> On Wed, Oct 31, 2012 at 4:26 PM, israguy <guy.i...@gmail.com> wrote:
>>>> ah good to know. I thought it should takes it from the assets directory
>>>> now I have a different problem.. that the actual create.js.erb is bring >>>> served and not run..
>>>> On Wednesday, October 31, 2012 6:03:52 PM UTC+2, Hassan Shahid wrote:
>>>>> it's looking for a create.js.[erb/haml] file under app/views/devise/** >>>>> registrations/
>>>>> Because you're asking it to respond to a JS request, it's not going to >>>>> render your create.html.[erb/haml] template.
>>>>> Lastly, a *.js.[erb/haml] is a javascript file that can execute ruby >>>>> code using either erb or haml, based on the extension you provide it.
>>>>> If you don't want to render any template, you need to tell it to >>>>> render nothing:
>>>>> def sample_method >>>>> respond_to do |format| >>>>> format.js { render :nothing => true} >>>>> end >>>>> end
>>>>> - Hassan
>>>>> On Wed, Oct 31, 2012 at 11:57 AM, israguy <guy.i...@gmail.com> wrote:
>>>>>> if I try to send the registration information via :remote => true.
>>>>>> As far as I understand, using remote true will ensure that the form >>>>>> is sent with an ajax post, but once I hit submit I see that the server >>>>>> returns the missing template error.
>>>>>> I read somewhere that the registration controller is already using >>>>>> respond_with (I see in the code) which means that it should respond to the >>>>>> ajax.
>>>>>> Can someone clarify that or if I am missing a piece in the puzzle?