mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 21:10:54 +00:00
25 lines
543 B
Ruby
25 lines
543 B
Ruby
class CustomUrlsController < ApplicationController
|
|
def administrate
|
|
raise AccessError unless cuser && cuser.admin?
|
|
end
|
|
|
|
def create
|
|
raise AccessError unless request.xhr?
|
|
end
|
|
|
|
def show
|
|
custom_url = CustomUrl.find_by_name(params[:name])
|
|
@article = custom_url.article
|
|
raise AccessError unless @article.can_show? cuser
|
|
@article.read_by! cuser if cuser
|
|
render 'articles/show'
|
|
end
|
|
|
|
def update
|
|
raise AccessError unless request.xhr?
|
|
end
|
|
|
|
def destroy
|
|
raise AccessError unless request.xhr?
|
|
end
|
|
end
|