This file contains 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
<%= form_for([@project, @survey], :html => { :class => 'form' })do |f| %> | |
<%= f.collection_select :survey_builder_id, SurveyBuilder.all, :id, :name, :include_blank => "Seleccione Plantilla"},class: 'select2'%> | |
<%= f.submit class: 'btn btn-success' %> | |
<% end %> |
This file contains 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 Article < ActiveRecord::Base | |
has_attached_file :cover, styles: { medium: "1280x720", thumb: "800x600" } | |
validates_attachment_content_type :cover, content_type: /\Aimage\/.*\Z/ | |
end |
This file contains 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
gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries |
This file contains 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
<%= form_tag({controller: "survey_trans", action: "password_confirmation"}, {method: :get}) do |f| %> | |
<%= text_field_tag :password_confirmation, params[:password_confirmation], class: "form-control", placeholder: "password" %> | |
<% end %> |
This file contains 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 SurveyTransController < ApplicationController | |
skip_before_filter :authenticate_user! | |
layout "survey" | |
def survey | |
end | |
def password_confirmation | |
# if params[:password_confirmation].present? && params[:survey_id].present? | |
@survey = Survey.find_by_id(params[:survey_id]) |
This file contains 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 Answer < ActiveRecord::Base | |
attr_accessor :array_response | |
def initialize | |
self.array_response = [] | |
end | |
end |
This file contains 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
<%= form_tag search_path, method: :get do %> | |
<%= text_field_tag :q, nil %> | |
<% end %> |
This file contains 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 Role < ActiveRecord::Base | |
has_many :users | |
end | |
class User < ActiveRecord::Base | |
belongs_to :role | |
end |
This file contains 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
User | |
belongs_to :company | |
Company | |
has_many :employees, class_name: "User" | |
has_many :clients, class_name: "User" | |
# ---- | |
companyA.clients.count | |
3 | |
companyA.employees.count |
This file contains 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
2016-12-19T15:33:56.927Z 7489 TID-ox4ubmy98 INFO: Booting Sidekiq 4.2.7 with redis options {:size=>27, :url=>"redis://localhost:6379/0"} | |
11:33:56 worker.1 | "[Sidekiq] Running locally, so autoscaler isn't used" | |
11:33:58 worker.1 | 2016-12-19T15:33:58.356Z 7489 TID-ox4ubmy98 INFO: Running in ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] | |
11:33:58 worker.1 | 2016-12-19T15:33:58.356Z 7489 TID-ox4ubmy98 INFO: See LICENSE and the LGPL-3.0 for licensing details. | |
11:33:58 worker.1 | 2016-12-19T15:33:58.356Z 7489 TID-ox4ubmy98 INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org | |
11:33:58 worker.1 | 2016-12-19T15:33:58.361Z 7489 TID-ox4ubmy98 INFO: Starting processing, hit Ctrl-C to stop | |
11:34:10 worker.1 | 2016-12-19T15:34:10.773Z 7489 TID-ox4vqdyhs MyWorker JID-882bc1314ea2ee37435e89ce INFO: start | |
11:34:10 worker.1 | 2016-12-19T15:34:10.775Z 7489 TID-ox4vqe0x0 MyWorker JID-8d1f27f683ff53d80921744f INFO: start | |
11:34:10 worker.1 | 2016-12-19T15:34:10.798Z 7489 TID-ox4vq |