1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00

Merge pull request #223 from Intrepidd/patch-1

Separate code blocks in ruby to avoid bad coloring
This commit is contained in:
Jonas Nicklas 2014-10-28 16:02:04 +01:00
commit 6293bec2eb

View file

@ -138,10 +138,14 @@ you can retrieve it by passing a symbol.
class DashboardPolicy < Struct.new(:user, :dashboard)
# ...
end
```
```ruby
# In controllers
authorize :dashboard, :show?
```
```erb
# In views
<% if policy(:dashboard).show? %>
<%= link_to 'Dashboard', dashboard_path %>