Testing your active record methods using script/consoleIf you are using windows, you start the console by using this command:ruby script\consoleLinux:./script/consoleJust use the following command whenever you make changes to your model objects:reload!Instead of accessing your MySQL database withmysql -u -pYou can instead doscript/dbconsoleand if you database has a password, just doscript/dbconsole -p% script/dbconsole # connect … Continue reading Awesome: Working with the Rails console and all the tricks
Author: sandipransing
using rails acts as taggable on plugin
A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.Plugin Installationscript/plugin install git://github.com/mbleigh/acts-as-taggable-on.gitGem Installationgem install mbleigh-acts-as-taggable-on --source http://gems.github.comAuto Installinclude following line in environment.rbconfig.gem "mbleigh-acts-as-taggable-on", :source => "http://gems.github.com", :lib => "acts-as-taggable-on"Post Installation (Rails)1. script/generate acts_as_taggable_on_migration2. rake db:migrateUsageAdd following line in your model for which you wanted to be tagged.acts_as_taggable_on :tagsExampleclass Post < … Continue reading using rails acts as taggable on plugin
Specify rails version to use while creating rails project
I was having rails versions installed ranging from rails 1.2.3 to 2.3and i wanted to create rails project that uses rails 2.1.0.I was got stucked with this problem & finally got solutionYou can specify rails version to use while creating new rails application rails _2.1.0_ simple_blogThe above command will create simple blog application that will … Continue reading Specify rails version to use while creating rails project
