Skip to content
New issue

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

nested resources #1

Closed
madimov opened this issue Nov 12, 2017 · 1 comment
Closed

nested resources #1

madimov opened this issue Nov 12, 2017 · 1 comment

Comments

@madimov
Copy link
Owner

madimov commented Nov 12, 2017

some notes:
http://blog.8thcolor.com/en/2011/08/nested-resources-with-independent-views-in-ruby-on-rails/ (very useful tutorial). A useful comment:
If anyone else has the problem, I had to change the line in the create method from:
@comment = post.comments.create(params[:comment])
to:
@comment = post.comments.create(comment_params)
Also, the same change in the update method

http://www.korenlc.com/rails-generate-model-vs-resourse-vs-scaffold/

figuring out how to implement the update function in comments_controller without having to create a new comment every time you update one:
https://gist.github.com/jhjguxin/3074080
https://duckduckgo.com/?q=ruby+on+rails+find+params+update+ensted+resource&t=ffab&ia=qa
https://stackoverflow.com/questions/25100872/how-to-edit-update-a-nested-resource-on-rails-4 (maybe i could ask a similarly phrased question but with my specific situation?)

@madimov
Copy link
Owner Author

madimov commented Nov 12, 2017

generating separate scaffolds and linking resources afterwards worked

@madimov madimov closed this as completed Nov 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant