Feeds:
Posts
Comments

Posts Tagged ‘Ruby on Rails’

In some cases, you may want to have multiple foreign keys map to a single model. The following example explains how the “user_id” and “favorite_id” in a single table(Favourites) map to the User Model(table). class Favourite < ActiveRecord::Base belongs_to :user belongs_to :favourite_user, :class_name => “User”, :foreign_key => “favourite_id” end Now you can play around without [...]

Read Full Post »

Try, request.env[:REQUEST_URI] instead. That should fix your problem.

Read Full Post »

If you use the namespace route like the one below : map.namespace :user do |user| user.resources :invitations end Make sure you have the links like the following; <% form_for([:user,@invitations]) do |f| %> Don’t try with; <% form_for([@user,@invitation]) do |f| %>

Read Full Post »

Migration column type… Converts to MySQL field type… Available options :binary TINYBLOB, BLOB, MEDIUMBLOB, or LONGBLOB2 :limit => 1 to 4294967296 (default = 65536)2 :boolean TINYINT(1) – :date DATE – :datetime DATETIME – :decimal DECIMAL :precision => 1 to 63 (default = 10) :scale => 0 to 30 (default = 0)3 :float FLOAT – :integer [...]

Read Full Post »

I think you’re running Rails 2. This line will work only with Rails 1. The ‘model’ method is no longer supported.Remove that line from the code. (E.g) undefined method `model’ for ApplicationController:Class – Line 12 in applicaton.rb

Read Full Post »

The simple fix is to remove it from my config/environments/development.rb (or) production.rb file as it’s now been deprecated.

Read Full Post »

Download the ferret gem for windows from http://rubyforge.org/frs/?group_id=1028 (E.g) http://rubyforge.org/frs/download.php/34135/ferret-0.11.6-mswin32.gem Move to the directory where you downloaded the gem (cd Desktop/<download-location>) and do gem install <filename> (E.g) gem install ferret-0.11.6-mswin32.gem You may also need, gem install acts_as_ferret, for your project.

Read Full Post »

If you are getting the following error, here is a quick fix that will get you working again. You will need to manually copy the libmysql.dll to the rubybin directory. Search for libmysql.dll file and copy it to the rubybin folder and 

Read Full Post »

When you find this error alert in windows, make sure you do one of the following; Find the LIBMYSQL.dll file and add its location to the PATH(environment-variable) (or) copy LIBMYSQL.dll to the System32 directory.

Read Full Post »

If you find this error during rails installation, one solution may be this. Setting up http proxy Gem install behind proxy – MAC

Read Full Post »

« Newer Posts - Older Posts »