[RUBY] [Rails] Regarding the presence or absence of parentheses in the argument of the render method

Do you put parentheses in the argument of the render method? Can't you put it on?

In conclusion, ** both are OK **. You can omit the parentheses when calling methods in Ruby.

So it doesn't matter which way you write the following two.




render "posts/new"
* However, when writing complicated code, it is better to add parentheses to make it easier to understand the position of the delimiter.

Recommended Posts

[Rails] Regarding the presence or absence of parentheses in the argument of the render method
The presence or absence of! In Ruby method names does not mean destructive / non-destructive
[Order method] Set the order of data in Rails
The identity of params [: id] in rails
The difference between puts and print in Ruby is not just the presence or absence of line breaks
[Java] Handling of JavaBeans in the method chain
[Ruby On Rails] In the nested state, the description in parentheses written after Prefix in the link_to method
SSL in the local environment of Docker / Rails / puma
How to specify an array in the return value / argument of the method in the CORBA IDL file
Is the method of the primitive specialized IntFunction apply or applyAsInt?
[Rails] Where to be careful in the description of validation
Method definition location Summary of how to check When defined in the project and Rails / Gem
about the where method (rails)
Rails "render method" and "redirect method"
[Rails] How to omit the display of the character string of the link_to method
What is @Override or @SuppressWarnings ("SleepWhileInLoop") in front of the function? ?? ??
Replace preview by uploading by clicking the image in file_field of Rails
Which is faster, size or 0, as the argument of List # toArray?
[Ruby] Specify the argument name of the method. Meaning of the colon (:) at the end