mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-30 16:30:59 +00:00
Purged git history and removed sensitive information.
This commit is contained in:
commit
6bcc8dc76b
862 changed files with 25312 additions and 0 deletions
39
app/controllers/shoutmsgs_controller.rb
Normal file
39
app/controllers/shoutmsgs_controller.rb
Normal file
|
@ -0,0 +1,39 @@
|
|||
class ShoutmsgsController < ApplicationController
|
||||
respond_to :html, :js
|
||||
|
||||
def index
|
||||
@shoutmsgs = Shoutmsg.lastXXX.typebox
|
||||
end
|
||||
|
||||
def show
|
||||
if params[:id2]
|
||||
@shoutmsgs = Shoutmsg.recent.of_object(params[:id], params[:id2]).reverse
|
||||
else
|
||||
@shoutmsgs = Shoutmsg.recent.box
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@shoutmsg = Shoutmsg.new params[:shoutmsg]
|
||||
@shoutmsg.user = cuser
|
||||
raise AccessError unless @shoutmsg.can_create? cuser
|
||||
|
||||
unless @shoutmsg.save
|
||||
flash[:error] = t(:invalid_message)
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@shoutmsg = Shoutmsg.find params[:id]
|
||||
raise AccessError unless @shoutmsg.can_destroy? cuser
|
||||
@shoutmsg.destroy
|
||||
redirect_to_back
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def render_shoutmsgs shoutable_type = nil, shoutable_id = nil
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue