views:

55

answers:

1

Hey ,Guys! I want to use the method request.query_string to send the key-value to the controller,how can i use in the sentences;

=link_to 'excel' , reports_excel_path(:format => 'xls',:from => 'conversations')

Thank you!

A: 

Just specify your key value pairs in your link_to and it'll send them to the controller so ...

<%=link_to 'click here', :controller => 'news', :action => 'archives', :day => '17', :month => 'August', :year => '1979' %>

will send your parameters as a querystring (unless you've specified a route in routes.rb) so that

params[:day] will give you 17
params[:month] will give you August etc etc

concept47