I wanna do something like this in rails
Here is what I have so far in rails:
<%= form_for @order do |f| %>
<%= f.hidden_field :service,
You are using a hidden_field instead of a hidden_field_tag. Because you are using the non-_tag version, it is assumed that your controller has already set the value for that attribute on the object that backs the form. For example:
controller:
def new
...
@order.service = "test"
...
end
view:
<%= form_for @order do |f| %>
<%= f.hidden_field :service %>
<%= f.submit %>
<% end %>