Skip to content

Instantly share code, notes, and snippets.

RailsForZombies::Application.routes.draw do
match '/zombies/:name' => 'Zombies#index', :as =>'graveyard'
end
RailsForZombies::Application.routes.draw do
root :to => "Zombies#index"
end
RailsForZombies::Application.routes.draw do
match 'undead' => redirect('/zombies')
end
RailsForZombies::Application.routes.draw do
resources :zombies
match 'undead' => "Zombies#undead"
end
RailsForZombies::Application.routes.draw do
resources :zombies
end
class ZombiesController < ApplicationController
def index
render :text => 'success', :layout => nil
end
end
o--o--O--o--o--o <-- origin
|
a'--b'--c' <-- mywork
o--o--O--o--o--o <-- origin
| |
a--b--c--m <-- mywork
o--o--O--o--o--o <-- origin
|
a--b--c <-- mywork
class ZombiesController < ApplicationController
before_filter :find_zombie, :only => [:show]
before_filter :check_tweets_count
def show
render :action => :show
end
def find_zombie
@zombie = Zombie.find params[:id]