I’m trying to make a simple form, but it’s working not so fine.
This is my current form code:
%form{ :controller => 'tool', :action => 'activation', :method => 'post' }
%table{ :border => 0, :width => "100%", :height => "100%" }
%tr{ :align => "center", :valign => "center" }
%td
%input{ :type => "text", :name => "accountName" }
%input{ :type => "submit", :name => "submit", :value => "login" }
I am getting this url when trying to send data via form: 10.0.0.2:3000/activation.
I know that I can make route tool#activation to activation, but it’s a wrong way, I want to sent post query to 10.0.0.2:3000/tool/activation, but :action => 'tool/activation' also is a bad way as far as I understand.
Can you give me advice ?
You should use the rails helper tags.
See more here: http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html
Also, you should try to avoid unnecessary tables to style your layout. Instead, look to using CSS.