Vacuum with Rails
Goal: Displaying products from the Amazon Product Advertising API.
Goal: Displaying products from the Amazon Product Advertising API.
# uname -a
Linux myapp 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# pumactl -v
2.6.0
# pumactl -S /home/myapp/tmp/puma.state restart --config /home/myapp/config/puma.rb
Command restart sent success
See https://github.com/frankie-loves-jesus/demo-search if you want to try it out yourself.
When going to http://localhost:3000/forums/default/search:
| NameError in Forem::Forums#index | |
| Showing /home/dev/demo-search/app/views/layouts/application.html.erb where line #23 raised: | |
| undefined local variable or method `search_path' for #<#<Class:0x8a5b79f0>:0x8a5b70f4> | |
| Extracted source (around line #23): | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | 
% rake db:migrate
[...snip...]
% rake db:seed
rake aborted!
undefined method `id' for nil:NilClass
/home/dev/demo-search/db/seeds.rb:16:in `<top (required)>'
/home/dev/.rvm/gems/ruby-1.9.3-p448@brgen/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:223:in `load'
/home/dev/.rvm/gems/ruby-1.9.3-p448@brgen/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:223:in `block in load'
/home/dev/.rvm/gems/ruby-1.9.3-p448@brgen/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:214:in `load_dependency'
| unless user.nil? | |
| forum = Forem::Forum.find_or_create_by_name(:category_id => Forem::Category.first.id, :name => "Default", :description => "Default forem created by install") | |
| ######### | |
| topic1 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] }) | |
| topic1.user = user | |
| topic1.save! | |
| ######### | 
The mobile world changes almost daily. Expanding on http://scottwb.com/blog/2012/02/23/a-better-way-to-add-mobile-pages-to-a-rails-site/ -- which is sorta old -- what do you guys think of this mobile and tablet detection scheme?
Use case: The mobile and desktop versions of my Rails app are very different. Although they share the majority of views, JS and CSS (using media queries where applicable), there are cases where I need mobile-only and desktop-only views, JS and CSS.
All tablets should be treated as mobile.