set a language flag in database
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user