Skip to content

Views for polls fixed. has_admin_rights method created #221

Open
mmezher wants to merge 1 commit intorails-school:masterfrom
mmezher:master
Open

Views for polls fixed. has_admin_rights method created #221
mmezher wants to merge 1 commit intorails-school:masterfrom
mmezher:master

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