I really don't like that way of passing parameters and doesn't look very
rails-like.
So solution I can think of so far is to turn all of these links into
forms with hidden tags but I don't really like that either even though I
think it's better than now.
I don't understand what you mean. Even if you use hidden fields the
url will still look as in your examples. Or are you actually talking
about what the code in your view looks like. If so then, for example,
you can just add the parameters in link_to, so for example:
link_to 'Some Text', :controller => 'some_controller', :action =>
'some_action', :t => '2010-02-23', tt => 'Type1'
I don't understand what you mean. Even if you use hidden fields the
url will still look as in your examples. Or are you actually talking
about what the code in your view looks like. If so then, for example,
you can just add the parameters in link_to, so for example:
link_to 'Some Text', :controller => 'some_controller', :action =>
'some_action', :t => '2010-02-23', tt => 'Type1'
Colin
Sorry if didn't make myself clear. I just wanna get rid of the
parameters in the URL and pass them so they're not in the URL.
Sorry if didn't make myself clear. I just wanna get rid of the
parameters in the URL and pass them so they're not in the URL.
That requires a POST request.
If you want an URL that looks something like
"actions/new/678542324/851829735/Type1", then you could define a custom
route like "map.connect ':controller/:action/:id/:at/:t/:tt'", which
would enable you to add more parameters without labeling them in the url
itself, but I am not sure how well that works with restful resources.
I tried
map.connect '/actions/:action_id/add_date/:date', :controller =>
'actions', action => 'add_date'
instead of
map.connect ':controller/:id/:action/:action_id'
but that didn't work cause that's not what's not working.