Skip to content

Views for polls fixed. has_admin_rights method created #221

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmezher
Copy link
Collaborator

@mmezher mmezher commented Aug 12, 2016

Helper function has_admin_rights created so that only admins can view editing and destroy functions. has_admin_rights can be added to other views so that only admins can view different options.

…lper so that only admins can view editing and detroy functions
= link_to 'Show', poll
= render :partial => "polls/publish_link", :locals => {:poll => poll}.actions
= link_to 'Edit', edit_poll_path(poll) if has_admin_rights
= link_to 'Destroy', poll, method: :delete, data: { confirm: 'Are you sure?' } if has_admin_rights

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [105/80]

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

Successfully merging this pull request may close these issues.

2 participants