How to assign a specific id and name to hidden_field_tag?
Like this,
hidden_field_tag(:id => "page_no",:name => "page", :value => "1" )
Any idea!
hidden_field_tag("page_name", "1", :id => "page_no")
per http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-hidden_field_tag
Requires hidden_field_tag(name, value = nil, options = {})
hidden_field_tag(name, value = nil, options = {})
So, the third parameter for the parameters.
hidden_field_tag("page", "1", {:id => "page_no"}) specifies the name "page", the value "1" and the identifier "page_no"
hidden_field_tag("page", "1", {:id => "page_no"})
You must pass the first parameter as a name and the second as a value. In addition, you can override the name of parameters such as this.
<%=hidden_field_tag :param_name, 'param_value', {:id => 'ashish_id', :name => 'another_name'}%>
Source: https://habr.com/ru/post/1343588/More articles:improving scala code compilation time in Intellij IDEA - scalaAPI agnostic Vector3, Matrix, etc.? - c #How to register page requests with Apache? - htmlCppcheck error: using dangerous iterators - c ++How to run iphone application in background for a long time? - objective-cHow to create a unique id of 40 characters in git? why is it unique? - gitwhy java.net.UnknownHostException: Host not resolved: webservername.com:80? - androidHow to free an object pointer in a vector? - c ++c communication confusion - cRepeat method in EventKit Framework? - objective-cAll Articles