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
| <%= form_for @project do |f| %> | |
| <% if @project.errors.any? %> | |
| <div id="error_explanation"> | |
| <h2><%= pluralize(@project.errors.count, "error") %> prohibited | |
| this project from being saved:</h2> | |
| <ul> | |
| <% @project.errors.full_messages.each do |msg| %> | |
| <li><%= msg %></li> | |
| <% end %> | |
| </ul> |
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
| def insert_flash | |
| content_tag :div, class: 'flash' do | |
| flash.each do |name, msg| | |
| if msg.is_a?(String) | |
| concat( content_tag( :div, class: "fade in alert alert-#{ flash_type_to_bootstrap(name) }") do | |
| concat( button_tag( "×".html_safe, class: "close", "aria-hidden" => true, "data-dismiss" => "alert" ) ) | |
| concat( content_tag :div, msg, :id => "flash_#{name}" ) | |
| end ) | |
| 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
| _team_special.html.erb | |
| _team_normal.html.erb | |
| _team_keith.html.erb | |
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
| %body | |
| -if controller_name == 'home' | |
| :javascript | |
| $(document).on('ready page:load', function() { | |
| Shadowbox.init(); | |
| }); |
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
| def create_migration(table_name, columns="") | |
| utc_now = Time.now.getutc.strftime("%Y%m%d%H%M%S") | |
| class_name = table.classify.pluralize | |
| file "db/migrate/#{utc_now}_create_#{table}.rb", %{ | |
| class Create#{class_name} < ActiveRecord::Migration | |
| def change | |
| create_table(:#{table_name}) do |t| | |
| #{columns} | |
| t.timestamps | |
| 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
| Failures: | |
| 1) PostsController POST create with valid params creates a new Post | |
| Failure/Error: expect { | |
| count should have been changed by 1, but was changed by 0 | |
| # ./spec/controllers/posts_controller_spec.rb:47:in `block (4 levels) in <top (required)>' | |
| 2) PostsController POST create with valid params assigns a newly created post as @post | |
| Failure/Error: assigns(:post).should be_persisted | |
| expected persisted? to return true, got false |
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
| def get_filters | |
| searchable_named_columns.reduce({}) do |hash, col| | |
| hash[col.send(:name) || col['name']] = col | |
| end | |
| end | |
| def searchable_named_columns | |
| searchable_columns.select { |col| col.respond_to? :name } | |
| 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
| module ElasticSearch | |
| module RefreshIndex | |
| extend ActiveSupport::Concern | |
| included do | |
| after_save :refresh_index | |
| after_destroy :refresh_index | |
| end | |
| def refresh_index |
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
| <h4><%= comment.author %></h4> |
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
| <%= form_tag url_path, method: "get", id: "search", class: "form-inline", role: "form" do %> | |
| <%= end %> | |
| <%= render 'bulk_action_form' %> |