I’m new to Rails, and I’ve been working based off of a friend’s code: http://pastebin.com/6HwT6CBs
When I try to manipulate a variable (such as accuracy_ratio), Rails throws errors at me. Example:
@post = Post.new(params[:post]) #These lines work fine
@post.user = current_user
@post.name = @post.user.name
@post.accuracy_ratio = 1.0 #This one throws an error
On NetBeans Rails, when I type “@post.”, the variables user and name pop up underneath the autocomplete helper, but not accuracy_ratio.
I think this is because I need Rails to reconfigure changes I make to the table. Is this true? If not, does anyone know how I can solve this?
edit: thanks so much guys. as i said, im a ruby scrub. after running rake db:migrate i got it working.
Are you sure the type ‘double’ exists at all? Seems like your migration just failed. Use float or decimal instead(depending on your requirements).