Class: Admin::ViewsController
- Inherits:
-
AdminController
- Object
- AdminController
- Admin::ViewsController
- Defined in:
- app/controllers/admin/views_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/admin/views_controller.rb', line 16 def create add_sid(:view) @view = View.new(params[:view]) if @view.save redirect_to [:admin, @view], :notice => "Successfully created view." else render :action => 'new' end end |
#destroy ⇒ Object
39 40 41 42 43 |
# File 'app/controllers/admin/views_controller.rb', line 39 def destroy @view = View.find_sys_id(_sid, params[:id]) @view.destroy redirect_to admin_views_url, :notice => "Successfully destroyed view." end |
#edit ⇒ Object
26 27 28 |
# File 'app/controllers/admin/views_controller.rb', line 26 def edit @view = View.find_sys_id(_sid, params[:id]) end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/admin/views_controller.rb', line 4 def index @views = View.sys(_sid).all end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/admin/views_controller.rb', line 12 def new @view = View.new end |
#show ⇒ Object
8 9 10 |
# File 'app/controllers/admin/views_controller.rb', line 8 def show @view = View.find_sys_id(_sid, params[:id]) end |
#update ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'app/controllers/admin/views_controller.rb', line 30 def update @view = View.find_sys_id(_sid, params[:id]) if @view.update_attributes(params[:view]) redirect_to [:admin, @view], :notice => "Successfully updated view." else render :action => 'edit' end end |