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
Missing template layouts/application with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "/Users/mike.campbell/projects/engines/myengine_shell/app/views" * "/Users/mike.campbell/projects/engines/myengine/app/views" | |
# Myengine is the engine, and MyengineShell is an app which mounts it. | |
# When I create the engine it generates an application.html.erb layout file in app/views/layouts/myengine/application.html.erb. | |
# How come my app can't find the layout? |
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
ans = TestAnswer.find_by_test_id_and_question_number(test.id, question.number) | |
if ans.nil? | |
TestAnswer.create(test_id: test.id, question_number: question.number, answer: params[:answer]) | |
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
execute <<-SQL | |
CREATE TABLE #{t}2 LIKE #{t}; | |
INSERT INTO #{t}2 (SELECT * FROM #{t} GROUP BY #{c.join(", ")}); | |
DROP TABLE #{t}; | |
RENAME TABLE #{t}2 TO #{t}; | |
SQL | |
Error: | |
== AddIndexesOnJoinTables: migrating ========================================= |
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
<p class="notice" style="display: none;"></p> | |
<p class="errorExplanation" style="display: none;"></p> | |
<%= form_tag contact_path, remote: true do -%> | |
<ul> | |
<li><%= label_tag :subject %> <%= text_field_tag :subject %></li> | |
<li><%= label_tag :phone %> <%= text_field_tag :phone, nil, class: :required %></li> | |
<li><%= label_tag :message %> <%= text_area_tag :message, nil, rows: 6, class: :required %> | |
<span class="desc">Please provide as much detail as you can about the nature of your request.</span> | |
</li> | |
<li><%= button_tag "Send" %></li> |
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
Incident.joins(categories: [{category_marks: [{ user_group: :users }] }]) | |
.where("users.id = ? AND category_marks.inc = ?", user.id, true) | |
.group('incidents.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
[jgalang@rashomon:~/Code/skunkworks/2fa] | |
∴ ruby totp_demo.rb | |
Time(sec) Time (UTC format) Value of T(Hex) TOTP Mode OK | |
------------------------------------------------------------------------------------------ | |
59 1970-01-01 00:00:59 0000000000000001 94287082 SHA1 ✔ | |
59 1970-01-01 00:00:59 0000000000000001 46119246 SHA256 ✔ | |
59 1970-01-01 00:00:59 0000000000000001 90693936 SHA512 ✔ | |
1111111109 2005-03-18 01:58:29 00000000023523EC 07081804 SHA1 ✔ | |
1111111109 2005-03-18 01:58:29 00000000023523EC 68084774 SHA256 ✔ |
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-actions | |
- if params[:action] == "new" | |
= button_tag type: "submit", class: "btn btn-success btn-cons", | |
id: "submit" do | |
= fa_icon "check" | |
%span Create | |
= link_to courses_path, class: "btn btn-danger btn-cons" do | |
= fa_icon "close" | |
%span Cancel |
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
4 def import | |
5 unless params[:file].blank? | |
6 labels = Array.new | |
7 IO.foreach( params[:file].tempfile ) do |line| | |
8 if /;/.match( line ) | |
9 labels << line.split( ';' ) | |
10 elsif /,/.match( line ) | |
11 labels << line.split( ',' ) | |
12 else | |
13 labels << line |
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
.fields.condition{ "data-object-name" => f.object_name } | |
%p | |
= link_to_remove_fields t(:advanced_search_remove_condition), f | |
= f.attribute_fields do |a| | |
%span.fields{ "data-object-name" => f.object_name } | |
= a.attribute_select :associations => %w(account tags activities emails addresses) | |
= f.predicate_select({:only => [:cont, :not_cont, :blank, :present, :null, :not_null, :matches, :does_not_match, :eq, :not_eq, :lt, :gt], :compounds => false}, :class => "predicate") |
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
SELECT `students`.`id` | |
FROM `students` | |
LEFT OUTER JOIN `klasses_students` | |
ON `klasses_students`.`student_id` = `students`.`id` | |
LEFT OUTER JOIN `klasses` | |
ON `klasses`.`id` = `klasses_students`.`klass_id` | |
WHERE (klasses_students.klass_id IN (360,377,378)) | |
AND (students.name LIKE '%charles%') | |
ORDER BY surname ASC, firstname ASC |