def inherited(base)
unless base.abstract_railtie?
base.called_from = begin
# Remove the line number from backtraces making sure we don't leave anything behind
call_stack = caller.map { |p| p.sub(/:\d+.*/, '') } #line 365
File.dirname(call_stack.detect { |p| p !~ %r[railties[\w.-]*/lib/rails|rack[\w.-]*/lib/rack] })
end
end
super
end
MacBook-Pro-Dmitrij:TwiSup dmsilaev$ LANG="ru_RU.utf8" rails s
/Users/dmsilaev/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/engine.rb:365:in `sub': invalid byte sequence in US-ASCII (ArgumentError)
from /Users/dmsilaev/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/engine.rb:365:in `block in inherited'
from /Users/dmsilaev/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/engine.rb:365:in `map'
TwiSup::Application.routes.draw do
get "tags/index"
resources :questions
root :to => "home#index"
match "/auth/:provider/callback" => "sessions#create"
match '/tags/:name' => "home#tags"
match "/signout" => "sessions#destroy", :as => :signout
end
# encoding: utf-8
class HomeController < ApplicationController
...
def tags
@tagged_query = "#"+(params[:name])
@questions = Question.tagged_with(@tagged_query).order("created_at DESC")
end
...
end