Class: Faalis::Dashboard::GroupsController
- Inherits:
-
Dashboard::ApplicationController
- Object
- Dashboard::ApplicationController
- Faalis::Dashboard::GroupsController
- Defined in:
- app/controllers/faalis/dashboard/groups_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/faalis/dashboard/groups_controller.rb', line 22 def create Faalis::Group name = group_params[:name] @group = Faalis::Group.new(name: name, role: name.underscore) @group. = respond_to do |f| if @group.save f.js f.html else f.js { render :errors } f.html end end end |
#edit ⇒ Object
17 18 19 20 |
# File 'app/controllers/faalis/dashboard/groups_controller.rb', line 17 def edit @group = Faalis::Group.find(params[:id]) @group end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/faalis/dashboard/groups_controller.rb', line 6 def index Faalis::Group @groups = Faalis::Group.all end |
#new ⇒ Object
11 12 13 14 |
# File 'app/controllers/faalis/dashboard/groups_controller.rb', line 11 def new Faalis::Group @group = Faalis::Group.new end |
#update ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/controllers/faalis/dashboard/groups_controller.rb', line 42 def update @group = Faalis::Group.find(params[:id]) @group @group. = @group.name = group_params[:name] @group.role = group_params[:name].underscore respond_to do |f| if @group.save f.js f.html else f.js { render :errors } f.html end end end |