Ale Ds wrote:
> Hi everyone, I am stuck in an (apparently) simple problem.
> In my event_controller I have the i_like_it action:
> 
>   def i_like_it
>     @event = Event.find(params[:id])
> 
>     ... # logic
> 
>     respond_to do |format|
>       format.js
>     end
>   end
> 
> In my case "i_like_it" is called with :method => PUT (it is an Ajax
> call, "i_like_it.js.erb" will be returned as a script and it wil be
> executed on the browser.)
> 
> I would like render a Javascript file with a different name (not
> i_like_it.js.erb) , but I haven't found any option in the Rails API
> docs.
> 
> respond_to do |format|
>   format.js { render ??? }
> end

Here you go-

respond_to do |format|
  format.js { render :action => 'different_name.js.erb'}
end
-- 
Posted via http://www.ruby-forum.com/.

-- 
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-t...@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