Class: TopicsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- TopicsController
- Defined in:
- app/controllers/topics_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/topics_controller.rb', line 16 def create topic.label = Whitelabel[:label_id] topic.user = current_user if topic.save if current_user.email.blank? redirect_to(edit_user_path(current_user), notice: t("flash.add_email")) else redirect_to(topic_path(topic), notice: t("flash.topic_added")) end else redirect_to(new_topic_path, alert: topic.errors..join(', ')) end end |
#edit ⇒ Object
14 |
# File 'app/controllers/topics_controller.rb', line 14 def edit; end |
#index ⇒ Object
11 |
# File 'app/controllers/topics_controller.rb', line 11 def index; end |
#new ⇒ Object
13 |
# File 'app/controllers/topics_controller.rb', line 13 def new; end |
#show ⇒ Object
12 |
# File 'app/controllers/topics_controller.rb', line 12 def show; end |
#update ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/controllers/topics_controller.rb', line 30 def update if topic.save redirect_to(topic_path(topic), notice: t("flash.topic_updated")) else redirect_to(edit_topic_path, alert: topic.errors..join(', ')) end end |