2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/under_construction_email_storage_controller.rb', line 2
def create
@email = UnderConstructionEmailStorage.new(params[:under_construction_email_storage])
respond_to do |format|
if @email.valid?
@email.save_to_file
@notice = I18n.t('controllers.under_construction_email_storage.create.flash.success', default: "Your email added successfully")
format.html { redirect_to under_construction_index_path,
notice: I18n.t('controllers.under_construction_email_storage.create.flash.success',
default: "Your email added successfully"
)}
format.js { render template: "under_construction/#{UnderConstruction.config.theme}/create" }
else
@alert = @email.errors.full_messages[0]
format.html { redirect_to under_construction_index_path, alert: @email.errors.full_messages }
format.js { render template: "under_construction/#{UnderConstruction.config.theme}/create" }
end
end
end
|