It is the first time I post questions here.
I have nine buttons in html pass to ruby on rails.
Here is the params I want to loop:
Button.new(:title => params[:button_title_1], :order => 1, :icon_url => params[:button_icon_1], :navigation_id => @navigation.id,
:next_navigation => params[:selected_navigation_1].to_i, :next_page => params[:selected_page_1].to_i)
I want to turn the number 1 to i and put it to below loop:
@buttonNumber.each do |i|
end
Please help! Thanks!
“to_sym” is optional, because params collection is HashWithIndifferentAccess, i put it for more understanding for other situations.