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
category = FactoryGirl.create(:category) | |
section = FactoryGirl.create(:section, category: association(category)) |
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
ActiveRecord::Schema.define(:version => 20120609145912) do | |
create_table "categories", :force => true do |t| | |
t.string "name" | |
t.datetime "created_at", :null => false | |
t.datetime "updated_at", :null => false | |
end | |
create_table "sections", :force => true do |t| | |
t.string "name" |
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
%h2 Categories | |
- @categories.each do |category| | |
%ul | |
%li | |
%h3= link_to category.name, [category] | |
%ul | |
- Category.find(category.id).sections.each do |section| | |
%li= link_to section.name, [category, section] |
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
%h2= @category.name | |
- @category.sections do |section| | |
%ul | |
%li= link_to section.name, [@category, section] |
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
when /^the section page for (.*)$/i | |
section = Section.find(:all, conditions: {name: $1}) | |
[section.category, section] |
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
when /^the category section page for "(.*)"$/i | |
category = Category.find_by_name($1) | |
category_sections_path(category) | |
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
wrong number of arguments (1 for 0) (ArgumentError) | |
./app/controllers/sections_controller.rb:3:in `index' | |
./features/step_definitions/web_steps.rb:45:in `/^(?:|I )am on (.+)$/' | |
features/viewing_sections.feature:16:in `And I am on the category section page for "Textbooks"' |
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
resources :categories do | |
resources :sections do | |
get :index => 'category#show' | |
resources :listings | |
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
PetrescueAdmin::Application.routes.draw do | |
devise_for :users | |
root to: redirect("/users/sign_in") | |
resources :groups, only: [:new, :create, :show] | |
get 'rescue_directory' => 'groups#index' | |
get 'rescue_directory/:state' => 'groups#list_by_state' | |
resources :listings, only: [: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
import sublime, sublime_plugin, os, time | |
class GoToSpecCommand(sublime_plugin.WindowCommand): | |
def open_left(self, file): | |
self.window.open_file(file) | |
if self.window.active_group() == 0: | |
return | |
self.window.run_command('close') | |
self.window.run_command('set_layout', |