access params hash in controller
问题 I have a link <%= link_to 'Add link', new_link_path(:link => {:item1_id => @item.id}) %> passing to def new @link = Link.new(params[:link]) @items = Item.all form is <%= form_for(@link) do |f| %> <%= f.hidden_field :item1_id %> <%= f.collection_select :item2_id , Item.all , :id , :name %> So I want to access like the image linked to the item1_id item. How do I access it? i tried @item1 = Item.find_by_id(params[:link]) and @item1 = Item.find_by_id(params[:item_id]) but I don't know what is