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
Started POST "/tickets/1/comments" for 127.0.0.1 at 2012-04-03 12:16:25 -0600 | |
Processing by CommentsController#create as HTML | |
Parameters: {"utf8"=>"✓", "comment"=>{"text"=>"Is it out yet?"}, "tags"=>"", "commit"=>"Create Comment", "ticket_id"=>"1"} | |
[1m[36mState Load (0.0ms)[0m [1mSELECT "states".* FROM "states" [0m | |
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1 | |
[1m[36mTicket Load (0.0ms)[0m [1mSELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1[0m [["id", "1"]] | |
[1m[35mProject Load (0.0ms)[0m SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1 | |
[1m[36mPermission Load (0.0ms)[0m [1mSELECT "permissions".* FROM "permissions" WHERE "permissions"."user_id" = 2[0m | |
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1 | |
[1m[36mTicket Load (0.0ms)[0m [1mSELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = 1 LIMIT 1[0m |
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
resources :sites, except: [:new, :edit, :index, :show, :update, :destroy, :create] do | |
member do | |
get :home | |
get :about_us | |
get :faq | |
get :discounts | |
get :services | |
get :contact_us | |
get :admin | |
get :posts |
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
Jensenlocksmithing::Application.routes.draw do | |
get "log_out" => "sessions#destroy", as: "log_out" | |
get "log_in" => "sessions#new", as: "log_in" | |
#scope "(:locale)", :defaults => { :locale => "en" } do | |
#scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do | |
resources :sites, except: [:new, :edit, :index, :show, :update, :destroy, :create] do | |
member do | |
get :home |
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
Jensenlocksmithing::Application.routes.draw do | |
get "log_out" => "sessions#destroy", as: "log_out" | |
get "log_in" => "sessions#new", as: "log_in" | |
get "sites/services" | |
scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do | |
resources :sites, except: [:new, :edit, :index, :show, :update, :destroy, :create] do | |
collection do | |
get :home | |
get :about_us |
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
Jensenlocksmithing::Application.routes.draw do | |
scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do | |
get "log_out" => "sessions#destroy", as: "log_out" | |
get "log_in" => "sessions#new", as: "log_in" | |
resources :sites, except: [:new, :edit, :index, :show, :update, :destroy, :create] do | |
collection do | |
get :home | |
get :about_us |
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 CategoriesController < ApplicationController | |
before_filter :add_breadcrumbs | |
before_filter :authorize, only: [:new, :create, :new_subcategory, :update, :edit] | |
def new | |
add_breadcrumb "New Category", new_category_path | |
@category = params[:id] ? Category.find(params[:id]).children.new : Category.new | |
@count = Category.count | |
end | |
def new_subcategory |
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 ThankYou | |
def initialize(name, custom_message = nil) | |
@name = name | |
custom_message.nil? ? @custom_message = "Thank you" : @custom_message = custom_message | |
end | |
def greet | |
puts "#{@custom_message}, #{@name}" | |
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
defmodule Rumbl.Auth do | |
import Plug.Conn | |
import Comeonin.Bcrypt, only: [checkpw: 2, dummy_checkpw: 0] | |
def init(opts) do | |
Keyword.fetch!(opts, :repo) | |
end | |
def call(conn, repo) do |
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
test "requires user authentication on all actions", %{conn: conn} do | |
Enum.each([ | |
get(conn, video_path(conn, :new)), | |
get(conn, video_path(conn, :index)), | |
get(conn, video_path(conn, :show, "123")), | |
get(conn, video_path(conn, :edit, "123")), | |
put(conn, video_path(conn, :update, "123", %{})), | |
post(conn, video_path(conn, :create, %{})), | |
delete(conn, video_path(conn, :delete, "123")), | |
], fn conn -> |
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
# Coming soon to a ruby script near you! |
OlderNewer