0

I'm using Rails 3.1 and my view return to controller this parameter (I've checked it on web server log):

"warehouse"=>{"asset"=>"turiturira", "serial"=>"caricarira", "project_id"=>"1", "hardware"=>{"brand_id"=>"21"}, "hardware_id"=>"60", "state_id"=>"4", "position_id"=>"1", "logicalwarehouse_id"=>"3", "extra_id"=>"3"}, "bulk_warehouse_serial270"=>"t", "bulk_warehouse_asset270"=>"test", "enable_record270"=>"1", "bulk_warehouse_serial271"=>"uela2", "bulk_warehouse_asset271"=>"bela2", "enable_record271"=>"1"} 

and now I should use this parameter. I know that if I need all warehouse parameter I may do something such as:

@warehouse = Warehouse.new(params[:warehouse]) 

but if I need a single parameter inside "warehouse" how can I do? Suppose that I want set @serial variable to "bulk_warehouse_serial270" value ("test"); should I do something such as:

@serial = params(:warehouse[:bulk_warehouse_serial270]) 

or instead something such as:

@serial = params(:warehouse)params(:bulk_warehouse_serial270) 

Anyone can help me?

1 Answer 1

5

That's params[:warehouse][:asset]

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.