Download
Last version is always available on Google Code:Google Code downloads
Instalation
- uncompress files from archive
- put folder suspend-plugin in .gnome2/rhythmbox/plugins
ERROR 1005 (HY000) at line 296: Can't create table './debradb/comment.frm' (errno: 150)
check what is going on by passing this sql command to mysql command line:
SHOW ENGINE INNODB STATUS;
and next look for error ;). In most case errors are made by
Simple, if you generate scaffold, edit show.html.erb and remove h
<%=h @static.content %>
Next day learning Ruby on Rails. My first question was, where is documentation, where is entry point. Of course, there is lots of screencast (grr..), videocast, voicecast, but I was looking for documentation similarly to django. You know, page where there would be described all functions. I don't think about API doc, for first user is too hard to understand and to find entry point.
Scaffolds, something that is called killer function. Well it's nice when everything is generated, but why for holy shit I can't add new method to controller. For example I try to add method login and call controller using url /users/login. What I get? Of course error, login could not be find. For goodness what login, I try to call method, not to show object. Developers like an user shouldn't be taken by surprise.
Models with migration are very nice functionality, I saw it last day in Doctrine.
Conventions, conventions and again conventions. You have to write upper case letters, end table with s and other strange CONVENTIONS. I hate it. In django/python I have on, use tabs or spaces to indent and that's all.
Short post, as a note for future. To use gettext with RoR you have to do
sudo gem install gettext
controllers/application.rb to
require 'gettext/rails'
class ApplicationController < ActionController::Base
init_gettext 'myapp'
helper :all # include all helpers, all the time
# See ActionController::RequestForgeryProtection for details
# Uncomment the :secret if you're not using the cookie session store
protect_from_forgery # :secret => 'fda6e0e8ddfd10693079c4bcdb4b6874'
# See ActionController::Base for details
# Uncomment this to filter the contents of submitted sensitive data parameters
# from your application log (in this case, all fields with names like "password").
# filter_parameter_logging :password
end
config/environment.rb this code
require 'gettext/rails'
Rackfile some tasks
require 'gettext/utils'
desc "Create mo-files for L10n"
task :makemo do
GetText.create_mofiles(true, "po", "locale")
end
desc "Update pot/po files to match new version."
task :updatepo do
MY_APP_TEXT_DOMAIN = "myapp"
MY_APP_VERSION = "myapp 1.1.0"
GetText.update_pofiles(MY_APP_TEXT_DOMAIN,
Dir.glob("{app,lib}/**/*.{rb,rhtml}"),
MY_APP_VERSION)
end
libintl-gettext-ruby package in your system (I am spiking about Ubuntu Linux)
Very important thing, you have to restart web server to commit this changes. Also if you get 500 Internal Server Error you have to create file gettext.rb in config/initializersconfig/initializers/gettext.rb
module ActionView
class Base
delegate :file_exists?, :to => :finder unless respond_to?(:file_exists?)
end
end
More information: