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
> end


The 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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to