I'm trying to save a string to the database and output it from the view. Just starting to learn RoR, so a bit confused here...
Here's what I did:
- generate model test id :string value :string
followed by
- rake db:migrate
then I opened the rails console from ./script/rails console
I'm trying to type this here:
test.create!(:value => "Hello World")
but it returns "ArgumentError: wrong number of arguments" :( How can I do this correctly? Also, how can I store this to a variable and output it in the view?
Thanks!
Test.create!(:value => "Hello World").createis a class method.