Move update favorites to a separate action

Introduce a separate action `toggle_favorite` to update user favorites events.
Otherwise users with permissions to update the event can have it as favorite.
This commit is contained in:
Ana María Martínez Gómez 2017-03-19 10:34:14 +01:00 committed by Henne Vogelsang
parent 059b5cbf84
commit 2485923319
4 changed files with 28 additions and 31 deletions

View file

@ -11,7 +11,7 @@
= link_to('#', onClick: 'starClicked();') do
%span#star-events{ class: "fa fa-lg #{ event.favourite_users.exists?(current_user.id) ? 'fa-star' : 'fa-star-o' }", |
"aria-hidden" => "true", |
"data-url" => conference_program_proposal_path(@conference.short_title, event.id), |
"data-url" => toogle_favorite_conference_program_proposal_path(@conference.short_title, event.id), |
"data-user" => current_user.id }
%span.h3
= event.title