On Mar 1, 12:48 am, Carlos Santana <[email protected]>
wrote:
> Thanks Fred..
>
> I don't have counties or cities controller right now. The
> get_counties/sections method is placed in the other controllers (users
> and exhibitions).
>
> I wanted to do this application RESTful way, however I haven't been
> successful in doing so. Your suggestion of making counties as a nested
> resource of cities was my initial thought. (And also user belongs to a
> county. ) However, when I tried to do RESTful the 'usual CRUD actions'
> (list, add, show, update, delete) for the user_controller worked but
> get_counties action did not work. The error being in Ajax.updater method
> as it uses POST and REST allowed only get, put, and delete.
>
You can use any method with an Ajax.Updater ( check the prototype api
docs).

> Can someone help me in understanding this?
> 1. Any suggestion for placing get_sections method?
> 2. And how to use actions in RESTful way? Many tutorials point to list,
> add, show, update, delete example.. But how can we do it for other
> actions. (In my case essentially it will be a list of counties
> pertaining to particular city..  But I don't know how to do this.. Any
> help appreciated..
>
You can have arbitrary actions on both members of a collection or the
collection itself. I don't think you need this here though. I would
recommend you read through the guide on routing (
http://guides.rubyonrails.org/routing_outside_in.html )

Fred

> Thanks,
> CS.
>
> Frederick Cheung wrote:
> > On Feb 28, 11:03 pm, Carlos Santana <[email protected]>
> > wrote:
> >> in general what will be the best place to add this method.
>
> > The more conventional way to do this would to have a single
> > get_counties action in the Cities controller (or expose counties as a
> > nested resource of cities, but you might want to leave that for
> > another day). Your if you change your ajax updater to make a request
> > to /some_controller/some_action then all of the pages using this
> > partial will make their ajax requests to the same place
>
> > Fred
>
> --
> Posted viahttp://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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to