On 8/2/06, Guest <guest@guest.com> wrote:> I''m not sure how to go about doing this with the new CRUD
paradigm. I
> can''t seem to use a regular link_to_remote tag as I get a routes
error,
> and I''m not sure what the syntax is to call a non CRUD method with
> link_to_remote passing in an id param.
I''m only *just* figuring this out, so I''m not 100% sure on
this.
Assuming you have a default route ('':controller/:action/:id'')
set up
in your routes.rb file, you should still be able to use link_to_remote
like you used to.
Additionally, you can use the :member option to add new named routes
that take an id:
map.resources :articles, :member => { :links => :get }
would let you do
links_article_url(@article)
If you don''t want it to apply to a particular object, you use the
:collection option:
map.resources :articles, :collection => { :links => :get }
links_articles_url
You then render RJS in that action. As I said, I''ve only picked this
up last night really. Those examples should all work, but I''m not
positive that it''s the correct way to use them in the first place.
Pat