Open uschtwill opened 9 years ago
@alvinkatojr
Here we go. You said I should use a button. But I didn't get if that is a requirement or just a nice to have. From my understanding this should be an acceptable way of doing it, no? Even if it is not best practice or the most beautiful way to do it. Correct me, if I am wrong. Why is this failing?
post 'users/:id/entries/:id' => 'users#add_entry_to_bookmarks', as => :add_to_bookmarks
p
=entry.content
=link_to 'Add to your Bookmarks', "/users/#{current_user.id}/entries/#{entry.id}", :method => :post
def add_entry_to_bookmarks
@entry = Entry.find(params[:id])
@user = User.find(params[:id])
add_entry_to_bookmarks!(@user, @entry)
redirect_to user_entries_path
end
def add_entry_to_bookmarks!(user, entry)
user.entries << entry
end
Oh and this error already pops up when just loading the root.
@alvinkatojr High Prio!
Can't seem to get a hand on this one. Will need to run the code locally and see.
@alvinkatojr For the emergency, pull the newest changes. The version you cloned earlier was a bit messed up. The error does persist though.
Implemented association, now working on the corresponding views, then API.