9
votes
1answer
2k views
Rails console 'y' helper returns NameError rather than yaml-formatting output
I'm trying to use y object in Rails 3.2.6/Ruby 1.9.3 console to get nicely formatted yaml output for an ActiveRecord object, but for some reason it isn't working for me. I've used it in the past, but ...
48
votes
2answers
7k views
Use rvmrc or ruby-version file to set a project gemset with RVM?
I use RVM, the Ruby Version Manager to specify a Ruby version and a set of gems for each of my Rails projects.
I have a .rvmrc file to automatically select a Ruby version and gemset whenever I cd ...
5
votes
2answers
1k views
SimpleCov reports not generating in Rails 3 app after running RSpec tests with Spork
I just installed the SimpleCov gem to generate code coverage reports on my Rails 3.2.6 app, and it works great with RSpec, just not with Spork. I am able to get the desired correct report by running ...
9
votes
2answers
2k views
rake assets:precompile attempting to connect to database
I'm attempting to debug why my application is attempting to connect to my database when I run rake assets:precompile --trace.
I'm probably missing something in the stack trace...anyone see the ...
2
votes
3answers
93 views
undefined method `email' for nil:NilClass in Exibe the mail of table Father
I have a problem, i make this atribbuition i comment model:
class Comment < ActiveRecord::Base
attr_accessible :comment
belongs_to :post
belongs_to :user
and this in user model
class User ...
0
votes
2answers
173 views
error in foreman start for heroku during deploying rails application
I try to getting start with Rails 3.2.6 and Heroku. My Ruby version is 1.9.3 and my database.yml is like this:
development:
adapter: postgresql
encoding: utf8
reconnect: false
database: ...
0
votes
1answer
1k views
Mongoid Group By or MongoDb group by in rails
I have a mongo table that has statistical data like the following....
course_id
status which is a string, played or completed
and timestamp information using Mongoid's Timestamping feature
so my ...
15
votes
4answers
3k views
Ruby on Rails plural (controller) and singular (model) convention - explanation
As per Ruby on Rails convention, controller names get pluralized while model names are singular. Example : a Users controller, but a User model.
rails generate controller Users
rails generate model ...
17
votes
2answers
7k views
Rails 3.2, RSpec, Factory Girl : NameError: uninitialized constant Factory
Ive been following this introductory to Rails testing and Ive run into an issue I cant seem to find the solution to. Im very familiar with Rails but this is my first foray into testing.
Anyhow, I ...
6
votes
2answers
312 views
Is there a best practices/coherent way to update a database field that contains a hash key-value store?
I'm referring to Rails 3.2's Data Store feature, in which there's the option to store key-value stores in a textfield, even if you're using a relational database like MySQL...it works fine when ...
2
votes
1answer
334 views
Override ActiveRecord << operator on has_many :through relationship, to accept data for the join model
I have three classes: Person, Position, and Directory.
A Person has_many :directories, :through => :position.
A Directory has_many :people, :through => :position.
Both Person and Directory has_many ...
9
votes
3answers
239 views
rails activesupport notifications - wrong db runtime value
I'm trying to log requests for my REST API application. I'm using rails notifications for this , like here http://railscasts.com/episodes/249-notifications-in-rails-3
I can't understand how to solve ...
8
votes
1answer
1k views
Why has the InstanceMethods module been deprecated?
I love ActiveSupport::Concern.
It makes it easy to add functionality to your classes, with a nice syntax.
Anyways, in Rails 3.2, the InstanceMethods module has been deprecated. If I understood ...
4
votes
1answer
237 views
Helpers use a lot of memory in rails 3(.2)
While migrating a rails 2 app to rails 3 I encountered a huge increase in memory used.
After some research I found out the helpers were the problem. Uncommenting any helpers in the view would speed ...
3
votes
3answers
1k views
Getting Ruby on Rails environment working and installing sqlite3
Trying to upgrade to the latest version of Ruby on Rails. I got ruby and rails installed ok (I think).
C:\Users\benjaminw>ruby --version
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]
...