We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm experiencing a weird issue. I've got a form which is shared between my update and create actions in Rails 5. Pretty standard pattern.
In my update action I can update the model in one step. Here's a simple examlpe showing the problem I'm facing:
def update @bottle = find_bottle if @bottle.update(bottle_params) redirect_to @bottle else render :edit end end
In my create action however I need to add an additional step for it to work:
def create new_bottle_params = bottle_params photos = new_bottle_params.delete :photos @bottle = Bottle.new new_bottle_params @bottle.save @bottle.update(photos: photos) if @bottle.persisted? redirect_to @bottle else render :new end end
If I don't split it up in create I get an error when saving saying that the photos are invalid.
The text was updated successfully, but these errors were encountered:
Add inverse_of option, fixes assembler#130
2c6b42d
Successfully merging a pull request may close this issue.
I'm experiencing a weird issue. I've got a form which is shared between my update and create actions in Rails 5. Pretty standard pattern.
In my update action I can update the model in one step. Here's a simple examlpe showing the problem I'm facing:
In my create action however I need to add an additional step for it to work:
If I don't split it up in create I get an error when saving saying that the photos are invalid.
The text was updated successfully, but these errors were encountered: