How do you debug a Sinatra app like a Rails app?
You could try adding a before filter that prints out the parameters before do puts ‘[Params]’ p params end
You could try adding a before filter that prints out the parameters before do puts ‘[Params]’ p params end
If you don’t want to spawn an array, there’s the conditional operator: max = a > b ? a : b
Sinatra and Rails use the path public for static content – e.g., ./public/javascripts/. All files in these paths would then be served by the web server (e.g. Thin, Passenger), but without the need for /public in the URL (e.g. the file at #{my_app_root}/public/javascripts/application.js would be available via the Web at the URL http://#{my_domain}/javascripts/application.js).
It is possible to chain where statements residentials = Residential.where(:is_active => true) residentials = residentials.where(:other_thing => true) if param_was_passed This should work. Make sure this is not the last line in a function call; repeat the residentials variable as the last line in that case. (As per @digger69 comment)
You can autoinclude everything under the lib folderand avoid these problems: Type this your file in config/application.rb config.autoload_paths += %W(#{config.root}/lib) config.autoload_paths += Dir[“#{config.root}/lib/**/”]
I ran this command and it now works: xcode-select –install
Inside the class itself: class_name = self.class On an initialized object named obj: class_name = obj.class
EventMachine 0.12.10 is known to not work under Ruby 1.9.2 on Windows. Please try latest 1.x pre-release versions: gem install eventmachine –pre If you’re using with Thin, latest version of Thin works with it properly. This has been discussed on RubyInstaller group several times.
It’s done with the gem command, see here gem owner my_gem -a [email protected]
What you want is next instead of return.