Sha256: 0a7295e277f80e215b61d621995f90c35c985e3370b0b11cc0340c9d12bf7851

Contents?: true

Size: 877 Bytes

Versions: 10

Compression:

Stored size: 877 Bytes

Contents

class Detour::GroupsController < Detour::ApplicationController
  def index
    @groups = Detour::Group.all
  end

  def show
    @group = Detour::Group.find(params[:id])
  end

  def create
    @group = Detour::Group.new(params[:group])

    if @group.save
      flash[:notice] = "Your group has been successfully created."
      render "detour/shared/success"
    else
      @model = @group
      render "detour/shared/error"
    end
  end

  def update
    @group = Detour::Group.find(params[:id])

    if @group.update_attributes(params[:group])
      flash[:notice] = "Your group has been successfully updated."
      redirect_to group_path @group
    else
      render :show
    end
  end

  def destroy
    @group = Detour::Group.find(params[:id])
    @group.destroy
    flash[:notice] = "Group \"#{@group.name}\" has been deleted."
    redirect_to groups_path
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
detour-0.0.15 app/controllers/detour/groups_controller.rb
detour-0.0.14 app/controllers/detour/groups_controller.rb
detour-0.0.13 app/controllers/detour/groups_controller.rb
detour-0.0.12 app/controllers/detour/groups_controller.rb
detour-0.0.11 app/controllers/detour/groups_controller.rb
detour-0.0.10 app/controllers/detour/groups_controller.rb
detour-0.0.9 app/controllers/detour/groups_controller.rb
detour-0.0.7 app/controllers/detour/groups_controller.rb
detour-0.0.6 app/controllers/detour/groups_controller.rb
detour-0.0.5 app/controllers/detour/groups_controller.rb