I'm trying to use the <% provide (:title, 'home') %> but a syntax error is returned. should I install a gem for it to work. Thanks in advance
1 Answer
In Ruby the parens around a method call are optional:
provide :title, 'home' But when using parens there should not be space between the method name and the parens:
def add(args*) args.sum end add 1, 2 # => 3 add(1,2) # => 3 add (1,2) # syntax error, unexpected ',', expecting ')' add (1+2), (1+2) # => 6 In the last examples you can see that Ruby treats the parens as a single argument when there is a space - which is why it gives a syntax error.
providemethod. What do you want to achieve here?