Doesn't seem to work. I don't understand how Rails forms are working...
If I have in my controller
PHP Code:
@hotels = Hotel.find_featured(params[:category], params[:type], params[:city_id])
and in my view
PHP Code:
City: <%= collection_select("city", "hotel[city_id]", @cities, "id", "name") %>
I get a complete hash in my model like that
'--- \n- city_id\n- \"4\"\n' I just try to get "4" in this case but can't extract it. Sometimes, Rails seems much more complicated than Java!
If someone has a good tutorial about forms, I really need it
Bookmarks