Agile Web Development with Rails 2nd edition, Chapter 9.3 (highlighting)
0 comments Posted by Slava at 1:09:00 AMHello,
I was trying to create my “depot” and just stuck with a problem at this chapter. I've always gotten that:
NoMethodError in Store#add_to_cart
Showing app/views/store/add_to_cart.rjs where line #3 raised:
undefined method `[]' for #
Extracted source (around line #3):
1: page.replace_html( "cart", :partial => "cart", :object => @cart )
2:
3: page[ :current_item ].visual_effect
4: :highlight,
5: :startcolor => "#88ff88",
6: :endcolor => "#114411" Thank G-d the solution was found here: http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg528878.html
It happens with Ruby 1.8.7 because it has String#chars as Enumerator but Rails expects an ActiveSupport::Multibyte::Chars object.
It has been starting to work after adding the following code into config/environment.rb:
unless '1.9'.respond_to?(:force_encoding)
String.class_eval do
begin
remove_method :chars
rescue NameError
# OK
end
end
end
Labels: Exploration, Rails, Ruby
Labels: Helicon Ape, ISAPI_Rewrite, Stuff
I'm happy Opera user and wish Opera Software to get the largest market piece ;)
Labels: Stuff
Nginx - light and fast web-server currently available on Windows. Official site says that it's only beta now and doesn't recommend to use it for production.
Anyway the news are great ;) Nginx doesn't use Cygwin but runs with Win32 API. Method select is using for connections processing, so the performance on Windows currently will be less than on Unix systems. All features available except IPv6, XSLT-filter and built-in Perl.
Installation is quite simple:
- Download Nginx
- Run commands:
cd c:\
unzip nginx-0.7.52.zip
ren nginx-0.7.52 nginx
cd nginx
start nginx
If Nginx don't start you should discover logs/error.log file. I've successfully ran the server on Windows Vista x64 :
Nginx on Windows isn't a service. Here are the commands to control web-server process:
nginx -s stop fast shutdown
nginx -s quit smooth shutdown
nginx -s reload configuration reset, new worker processes with
new configuration, smooth shutdown of old worker
processes.
nginx -s reopen reopen log-files
Labels: Exploration, Nginx
Helicon Ape configuration is easy and powerful. One string can make a lot of things. For example:
SetEnvIf MIME text/.* OR MIME application/javascript gzip=9 cache-enable=memIt enables GZIP compression and web-caching for text-files and JavaScript scripts. Easy and useful. Little but powerful. It's Helicon Ape ;)
Labels: Helicon Ape, mod_cache, mod_gzip, mod_setenvif



