This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="skillsForm"> | |
| <%= label_tag 'tag' %> | |
| <%= text_field_tag 'tags[]' %> | |
| <%= label_tag 'weight' %> | |
| <%= text_field_tag 'weights[]' %> | |
| <a href="#" id="removeTag">Remove</a> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "code": "ACE001", | |
| "name": "travel", | |
| "type": "expense" | |
| }, | |
| { | |
| "code": "ACE002", | |
| "name": "rent", | |
| "type": "expense" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @dataobject = Array.new | |
| for i in 0..5 | |
| @dataobject << '{"test" => "hello"}' | |
| end | |
| logger.info "datatojson:#{@dataobject.to_json}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @dataobject = Array.new | |
| for i in 0..5 | |
| @dataobject << {"test" => "hello"} | |
| end | |
| logger.info "datatojson:#{@dataobject.to_json}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Users::RegistrationsController < Devise::RegistrationsController | |
| def create | |
| logger.info "XXX Users::RegistrationsController create #{params[:company_name]}" | |
| build_resource(sign_up_params) | |
| if resource.save | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts "start" | |
| user_list = [ | |
| ["[email protected]", "$2a$10$dafuCz9ZJQLfbm3PZhrw0.mg1l5TpRjoq7xmPUbVmOeHSPcW7JLqq", | |
| "Test","Me","0101111111",1] | |
| ] | |
| user_list.each do |email, encrypted_password, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div> | |
| <%= f.label :country_id %><br /> | |
| <%= f.collection_select :country_id, Country.all, :id, :name %> | |
| </div> |