codegram / rack-webconsole

Rack-based interactive console (à la Rails console) for your web application's front-end
http://codegram.github.com/rack-webconsole
250 stars 50 forks source link

Rack::Webconsole.key_code = "231" Rack::Webconsole.key_code = "231" #43

Open grigio opened 12 years ago

grigio commented 12 years ago

I tried to put it in an initializer but it seems the .key_code method doesn't exist. How is possible to overrife it? thanks

txus commented 12 years ago

What version are you using?

grigio commented 12 years ago
rack-webconsole (0.1.2)
grigio commented 12 years ago

Rack::Webconsole.method_defined? 'key_code' => false

I tried with "rails c" an it seems it doesn't exist. If I switch to the american keyboard the webconsole works.

txus commented 12 years ago

If you use respond_to?, it returns true.

Rack::Webconsole.method_defined?("key_code") #=> false
Rack::Webconsole.respond_to?(:key_code) #=> true

Would you paste the initializer you were writing? Thanks.

grigio commented 12 years ago

I tried both in rails console an I get false for both.

rails s
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

Exiting
/Users/grigio/Code/opentalk/config/initializers/00_rails_config.rb:5: undefined method `key_code=' for Rack::Webconsole:Class (NoMethodError)

Inside 00_rails_config.rb I've:

RailsConfig.setup do |config|
  config.const_name = "Configs"
end

Rack::Webconsole.key_code = "231"
txus commented 11 years ago

I'll try to reproduce it locally and fix it.

OneDivZero commented 11 years ago

Yes I'm having exactly the same problem. Any other simple way to configure a default key_code ?

SeriousM commented 11 years ago

same problem here :(

ismarsantos commented 11 years ago

same problem here.

"undefined method `key_code=' for Rack::Webconsole:Class (NoMethodError)

About your application's environment Ruby version 1.9.3 (x86_64-linux) RubyGems version 1.8.24 Rack version 1.4 Rails version 3.2.13 JavaScript Runtime Node.js (V8) Active Record version 3.2.13 Action Pack version 3.2.13 Active Resource version 3.2.13 Action Mailer version 3.2.13 Active Support version 3.2.13 Middleware ActionDispatch::Static, Rack::Lock, #ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x0000000345b4f8, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport, Warden::Manager, Rack::Webconsole Application root /home/ismar/finance Environment development Database adapter sqlite3 Database schema version 20130422151531

txus commented 10 years ago

Still no idea what's going on. :(