Top "Ruby-on-rails-3" questions

Ruby on Rails is an open-source web development framework written in Ruby.

ActiveRecord: size vs count

In Rails, you can find the number of records using both Model.size and Model.count. If you're dealing with …

ruby-on-rails ruby ruby-on-rails-3 rails-activerecord
Is it possible to set ENV variables for rails development environment in my code?

I know that I can set my ENV variables in bash via export admin_password = "secret" But is there a …

ruby-on-rails ruby-on-rails-3
Convert UTC to local time in Rails 3

I'm having trouble converting a UTC Time or TimeWithZone to local time in Rails 3. Say moment is some Time variable …

ruby-on-rails ruby ruby-on-rails-3 timezone activesupport
Rails Model find where not equal

How can I find records in my database on a not equal condition? I have this now, but is there …

ruby-on-rails ruby-on-rails-3
Deleting all records in a database table

How do I delete all records in one of my database tables in a Ruby on Rails app?

ruby-on-rails ruby database ruby-on-rails-3
Ruby on Rails 3 Can't connect to local MySQL server through socket '/tmp/mysql.sock' on OSX

I have a standard Rails3 environment, RVM 1.2.9, Rails 3.0.5, Ruby 1.9.2p180, MySQL2 Gem 0.2.7, mysql-5.5.10-osx10.6-x86_64 Error I get when running …

mysql ruby-on-rails-3 macos
How to comment lines in rails html.erb files?

Am a newbie to rails , please let me know the way to comment out a single line and also to …

ruby-on-rails ruby-on-rails-3
How to replace a hash key with another key

I have a condition where, I get a hash hash = {"_id"=>"4de7140772f8be03da000018", .....} and I want this …

ruby-on-rails ruby ruby-on-rails-3 hash
Strip html from string Ruby on Rails

I'm working with Ruby on Rails, Is there a way to strip html from a string using sanitize or equal …

html ruby string ruby-on-rails-3
How do I prepare test database(s) for Rails rspec tests without running rake spec?

After significant troubleshooting, I figured out that I needed to run rake spec once (I can abort with control-c) before …

ruby-on-rails ruby-on-rails-3 rspec rspec2 specjour