Created
October 13, 2014 02:40
-
-
Save sameera207/a274243edbbe9c33090f to your computer and use it in GitHub Desktop.
accept nested attributes with rails4 strong params
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ItemsController < ApplicationController | |
#rest of your methods | |
# ...... | |
private | |
def item_params | |
params.require(:item).permit( | |
:name, | |
:content, | |
:image, | |
:address, | |
:country, | |
:country_code, | |
:user_id, | |
prices_attributes: [:price, :item_id, :user_id, :_destroy] | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment