have you tried using respond_to?
respond_to do |type|
type.js { render } # renders create.rjs
type.html { redirect_to :action => "index" }
type.xml do
headers["Location"] = post_url(:id => @post)
render(:nothing, :status => "201 Created")
end
end
On Sep 22, 2006, at 12:34 PM, Juanma Cervera wrote:
>
> Hello.
>
> I am using Edge Rails and trying the RESTful routing way.
> It works very nice.
>
> Now I am triying to use AJAX functions with observe_field and it seems
> that the changing event is never shooted.
>
> May this come from mixing two ways of calling actions in the same
> controller(two different types od URLs)?
>
> In this case, How to make a url function for the AJAX actions in
> route.rb?
>
> --
> 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-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
-~----------~----~----~----~------~----~------~--~---