mirror of
https://github.com/varvet/pundit.git
synced 2022-11-09 12:30:11 -05:00
Separate code blocks in ruby to avoid bad coloring
This commit is contained in:
parent
9a827581b4
commit
0220b200cc
1 changed files with 4 additions and 0 deletions
|
@ -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 %>
|
||||
|
|
Loading…
Reference in a new issue