Form helper not working

I was looking on

This example works fine

<%= form_tag("/search", method: "get") do %>
  <%= label_tag(:q, "Search for:") %>
  <%= text_field_tag(:q) %>
  <%= submit_tag("Search") %>
<% end %>

But I can’t get this example to work

form_tag({controller: “people”, action: “search”}, method: “get”, class: “nifty_form”)

But when try that in my erb file, I get this in my html

form_tag(controller: “people”, action: “search”, method: “get”, class: “nifty_form”)

which is clearly not valid html.

Also, should my controller be called person or people? I thought the controller should be singular and the table will be plural. Yet it has controller as plural.

ah, I got it now…

the form_tag requires <%=… %> around it

controllers are plural and models are singular.

1 Like

This topic is solved.