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.
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.
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)