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
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
> 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?
>
>
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,
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
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
6 matches
Mail list logo