Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No-Model Formtastic Form

I am looking to reproduce the following with Formtastic:

<% form_tag '/search', :method => 'get' do %>
  <%= text_field_tag :q, params[:q] %>
<% end %>

So far I have:

<% semantic_form_for :search, :html => { :method => :get } do |form| %>
  <% form.inputs do %>
    <%= form.input :q %>
  <% end %>
<% end %>

However, this requires access to the parameter hash using:

params[:search][:q]

Instead of my required:

params[:q]

I'd like to use Formtastic for all forms in the application I am working on, and so far I have only had problems with this one. Any ideas?

like image 840
Kevin Sylvestre Avatar asked Apr 08 '10 17:04

Kevin Sylvestre


1 Answers

<%= form.input :q, :input_html => { :name => 'q' } %>

like image 142
Ebrahim Mohammadi Avatar answered Oct 05 '22 08:10

Ebrahim Mohammadi