Hello, thanks for reading this. :) I''ve got some problems with RJS in separate files. What''s the correct extension? When I name it *.rjs / *.js.rjs, Ruby on Rails complains that it in not able to find a *.js.erb template. But when I name it *.js.erb, nothing is translated to javascript, only the raw text is given back to the client. When I try inline RJS directly in my controllers with "render :update ...", it runs perfectly. What am I doing wrong? Really thank you for any answers. ms --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The right naming is *.js.rjs At the end of the controller you need: respond_to do |format| format.js end to make that work --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Nov 11, 9:49 am, Thorsten Müller <thors...-1oxKqHKwyltBDgjK7y7TUQ@public.gmane.org> wrote:> The right naming is *.js.rjs > > At the end of the controller you need: > > respond_to do |format| > format.js > end > > to make that workKeep this bug report in mind if you''re calling #render_to_string before the default view is rendered: http://rails.lighthouseapp.com/projects/8994/tickets/870-js-rjs-views-no-longer-found-after-render_to_string-call The solution is to rename the default view to filename.rjs (as opposed to filename.js.rjs). Cheers, Nick --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---