Reputation: 662
Is there an environment where I can experiment with Rails helpers to create tags? I tried in the rails console but the functions seem not to be defined there. What I want is type this and get the output this would generate in a kind of REPL.
<%= form_tag(search_path, :method => "get") do %>
<%= label_tag(:q, "Search for:") %>
<%= text_field_tag(:q) %>
<%= submit_tag("Search") %>
<% end %>
Upvotes: 0
Views: 73
Reputation: 226
This should work:
helper.form_tag("/hello", :method => "get") do
helper.label_tag(:q, "Search for:")
helper.text_field_tag(:q)
helper.submit_tag("Search")
end
You can try this out in rails console.
Upvotes: 2