Module: Stiki::ApplicationHelper

Included in:
ApplicationController
Defined in:
app/helpers/stiki/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#has_access(action, model) ⇒ Object



7
8
9
10
11
12
13
# File 'app/helpers/stiki/application_helper.rb', line 7

def has_access( action, model )
  if Stiki.authorize_by == :cancan
    can? action, model
  else
    true
  end
end

#stiki_routesObject



3
4
5
# File 'app/helpers/stiki/application_helper.rb', line 3

def stiki_routes
  Stiki::Engine.routes.url_helpers
end

#user_name(author) ⇒ Object



15
16
17
18
19
# File 'app/helpers/stiki/application_helper.rb', line 15

def user_name( author )
  if Stiki.user_name_via 
    author.user.send( Stiki.user_name_via ) if author && author.user
  end
end