set a language flag in database

This commit is contained in:
2015-11-09 10:33:26 +01:00
parent d8f0d0da57
commit 003ebe7bd0
4 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ class SupportersController < ApplicationController
end
def create
@supporter = Supporter.new supporter_form_params
@supporter = Supporter.new supporter_form_params.merge(language: I18n.locale)
if !input_to_fast? && @supporter.save
redirect_to thanks_path
else
+2
View File
@@ -18,6 +18,7 @@ class Supporter
field :age_category, type: String
field :coordinates, type: Array
field :comments, type: String
field :language, type: String
validates :first_name, presence: true
validates :last_name, presence: true
@@ -27,6 +28,7 @@ class Supporter
validates :email, presence: true, uniqueness: true, format: /.+@.+\..+/i
validates :support, presence: true
validates :age_category, presence: true
validates :language, presence: true
def self.counter
actual = count.to_i