Skip to content

Instantly share code, notes, and snippets.

<div class="skillsForm">
<%= label_tag 'tag' %>
<%= text_field_tag 'tags[]' %>
<%= label_tag 'weight' %>
<%= text_field_tag 'weights[]' %>
<a href="#" id="removeTag">Remove</a>
</div>
[
{
"code": "ACE001",
"name": "travel",
"type": "expense"
},
{
"code": "ACE002",
"name": "rent",
"type": "expense"
@dataobject = Array.new
for i in 0..5
@dataobject << '{"test" => "hello"}'
end
logger.info "datatojson:#{@dataobject.to_json}"
@dataobject = Array.new
for i in 0..5
@dataobject << {"test" => "hello"}
end
logger.info "datatojson:#{@dataobject.to_json}"
class Users::RegistrationsController < Devise::RegistrationsController
def create
logger.info "XXX Users::RegistrationsController create #{params[:company_name]}"
build_resource(sign_up_params)
if resource.save
class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table(:users) do |t|
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at
class AddFieldsToUsers < ActiveRecord::Migration
def change
add_column :users, :firstname, :string
add_column :users, :lastname, :string
add_column :users, :phone_mobile, :string
add_column :users, :activated, :boolean
add_reference :users, :country, index: true
end
end
puts "start"
user_list = [
["test1@gmail.com", "$2a$10$dafuCz9ZJQLfbm3PZhrw0.mg1l5TpRjoq7xmPUbVmOeHSPcW7JLqq",
"Test","Me","0101111111",1]
]
user_list.each do |email, encrypted_password,
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
belongs_to :country
has_many :company_user_assocs
<div>
<%= f.label :country_id %><br />
<%= f.collection_select :country_id, Country.all, :id, :name %>
</div>