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 have models Album & Picture.
Album
Picture
Album model:
class Album < ActiveRecord::Base has_many :pictures accepts_nested_attributes_for :pictures, reject_if: :all_blank, allow_destroy: true end
Picture model:
class Picture < ActiveRecord::Base acts_as_commentable belongs_to :album end
In my albums#show view, I have all pictures that belongs to the album. I want to add Comments for each picture.
albums#show
How can I added it? Since now in my controller I do:
#AlbumsController @picture = Picture.find(params[:id]) @new_comment = Comment.build_from( @picture, current_user, "" )
But this gives me same id for all pictures commentable_id and that id is the album's id.
id
pictures commentable_id
How can I do this correctly?
Thanks in advanced!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have models
Album
&Picture
.Album
model:Picture
model:In my
albums#show
view, I have all pictures that belongs to the album. I want to add Comments for each picture.How can I added it? Since now in my controller I do:
But this gives me same
id
for allpictures commentable_id
and thatid
is the album'sid
.How can I do this correctly?
Thanks in advanced!
The text was updated successfully, but these errors were encountered: