Re: [Rails] How can I get this create_table statement on one line?

2018-03-19 Thread Walter Lee Davis
Yes, you are absolutely correct. Block (if you squint) is kind of like a Proc, and the arguments in between the pipes are the parameters passed into the block. Walter > On Mar 19, 2018, at 12:18 AM, Robert Phillips > wrote: > > Isn't 't' a formal parameter

Re: [Rails] How can I get this create_table statement on one line?

2018-03-18 Thread Robert Phillips
On Sunday, 11 March 2018 14:36:30 UTC, Walter Lee Davis wrote: > > > . > > Here's a multi-line block format migration method: > > create_table :friendly_id_slugs do |t| > t.string :slug, :null => false > t.integer

Re: [Rails] How can I get this create_table statement on one line?

2018-03-11 Thread Walter Lee Davis
> On Mar 10, 2018, at 9:34 PM, Robert Phillips > wrote: > > Thanks, that works > > When I do create_table (:gars) { |t| t.string :name } > > What exactly is that syntax.. Like is the string of t.string, a method of the > t object, that takes a symbol? > >

Re: [Rails] How can I get this create_table statement on one line?

2018-03-10 Thread Robert Phillips
Thanks, that works When I do create_table (:gars) { |t| t.string :name } What exactly is that syntax.. Like is the string of t.string, a method of the t object, that takes a symbol? On Friday, 9 March 2018 16:33:51 UTC, Hassan Schroeder wrote: > > On Fri, Mar 9, 2018 at 12:42 AM,

Re: [Rails] How can I get this create_table statement on one line?

2018-03-09 Thread Hassan Schroeder
On Fri, Mar 9, 2018 at 12:42 AM, Robert Phillips wrote: > I can't get a create_table statement onto one line > > irb(main):019:0> ActiveRecord::Migration.create_table :wers { |t| t.string > :name } > SyntaxError: (irb):19: syntax error, unexpected '{', expecting

[Rails] How can I get this create_table statement on one line?

2018-03-09 Thread Robert Phillips
If I go to rails console I can't get a create_table statement onto one line irb(main):019:0> ActiveRecord::Migration.create_table :wers { |t| t.string :name } SyntaxError: (irb):19: syntax error, unexpected '{', expecting end-of-input Migration.create_table :wers { |t| t.string :name } I can