Hello all.
I currently have a method that is accessed from a form using this:
View:
<%= start_form_tag :action => :history %>
<p><label for="componentlog_cl_compname">Component
Name</label><br />
<%= text_field ''componentlog'',
''cl_compname'', :class => ''mandatory'',
:value => "#{session[:criteria]}" || nil %></p>
<%= submit_tag "Search", :class => "button" %>
<%= end_form_tag %>
controller:
unless request.post?
render :action => ''search''
else
value = params[:componentlog][:cl_compname].strip
etc etc etc
end
Now this works fine and if possible I wouldn''t want to change it. Now
lets say that I want to link to this form using a link_to with a POST
type to trigger the post event. Something along the lines of
<%= link_to "#{componentlog.cl_compname}", { :action =>
"history",
[componentlog][:cl_compname] => componentlog.cl_compname}, :post => true
%>
Trying the above results in a "Symbol as array index" error. How to I
construct the link_to statement so that it doesn''t fall over.
It wouldn''t suprise me if I found out I am doing everything in a less
than pefect way but hey, that is what first projects are for ;)
Many thanks.
Jeff
--
Posted via http://www.ruby-forum.com/.