On Jul 21, 5:24 am, Rails List <[email protected]>
wrote:
> Let us say, I have a page with couple of links and i would like to send
> unique flag/variable settings through params for each these links when
> they are clicked.
>
> For example:
>
> A link clicked - flag 'a' sent
> B link clicked - flag 'b' sent
>
> The exact scenario is that when the link is clicked, I have to perform a
> "find" to see if the params value exists in table 1 or 2 or 3...so on.
>
> This is a very bad design and it is costly in terms of performance.
>

When you generate a link you either pass a hash of routing options
(eg :controller => 'foo', :action => '...') or you call one of the
named route helpers (person_path(...)) which can also  take similar
options. You can add any options you want (although the rails way
these days would probably to make the table in question explicit in
the url path itself rather than as a query parameter)

Fred
> If I can set a flag/variable/indicator with each link, then I can
> straight away perform "find" in its corresponding table and execute the
> query.
>
> Any pointers are more appreciated.
> --
> 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