Class: AppsController

Inherits:
ApplicationController show all
Includes:
ProblemsSearcher
Defined in:
app/controllers/apps_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#stored_location_for

Instance Method Details

#createObject


57
58
59
60
61
62
63
64
65
# File 'app/controllers/apps_controller.rb', line 57

def create
  initialize_subclassed_notification_service
  if app.save
    redirect_to app_url(app), :flash => { :success => I18n.t('controllers.apps.flash.create.success') }
  else
    flash[:error] = I18n.t('controllers.apps.flash.create.error')
    render :new
  end
end

#destroyObject


81
82
83
84
85
86
87
88
# File 'app/controllers/apps_controller.rb', line 81

def destroy
  if app.destroy
    redirect_to apps_url, :flash => { :success => I18n.t('controllers.apps.flash.destroy.success') }
  else
    flash[:error] = I18n.t('controllers.apps.flash.destroy.error')
    render :show
  end
end

#editObject


77
78
79
# File 'app/controllers/apps_controller.rb', line 77

def edit
  plug_params(app)
end

#indexObject


48
# File 'app/controllers/apps_controller.rb', line 48

def index; end

#newObject


53
54
55
# File 'app/controllers/apps_controller.rb', line 53

def new
  plug_params(app)
end

#regenerate_api_keyObject


90
91
92
93
# File 'app/controllers/apps_controller.rb', line 90

def regenerate_api_key
  app.regenerate_api_key!
  redirect_to edit_app_path(app)
end

#showObject


49
50
51
# File 'app/controllers/apps_controller.rb', line 49

def show
  app
end

#updateObject


67
68
69
70
71
72
73
74
75
# File 'app/controllers/apps_controller.rb', line 67

def update
  initialize_subclassed_notification_service
  if app.save
    redirect_to app_url(app), :flash => { :success => I18n.t('controllers.apps.flash.update.success') }
  else
    flash[:error] = I18n.t('controllers.apps.flash.update.error')
    render :edit
  end
end