How I can get redirect_id
from this form?
<%= form_for(@category) do |f| %>
<%= hidden_field_tag :redirect_id, :value=>5 %>
<%= f.text_field :text %>
<% end %>
In controller I can get only category
params in my params
array.
Maybe because I'm using only this code to filter parameters in controller.
def panel_category_params
params.require(:category).permit(:text)
end
Following should work:
<%= hidden_field_tag 'redirect_id', 5 %>
See examples of using hidden_field_tag
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With