David Morales
2012-Feb-06 14:49 UTC
Why file.js.coffee.erb is not working with respond_to?
I would like to know why a coffee-script file is not working when it''s named as file.js.coffee.erb and used with respond_to. This is an example: my_controller.rb: def create> respond_to do |format| > format.html { render :new } > format.js { render :new } > end > endThe file in this case is named new.js.coffee.erb When the create route is called with Ajax, the HTML version (new.html.erb) is always returned. If I rename the js file as new.js.coffee then it works correctly. Why can''t the .erb suffix be added? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/K452JgyQN_UJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.