Reputation: 10035
I came upon the below code somewhere and can see that it will render a partial using some block. But what does the last part with the concat
do?
def method(stuff="example", &block)
content = render(:partial => 'some_partial',
:locals => { :content => capture(&block) }
)
concat(content)
end
Upvotes: 0
Views: 60
Reputation: 3018
The concat
method is used to output text, when it is not within an output block such as <%= %>
.
Upvotes: 0
Reputation: 27747
Concatenates the strings you pass it before rendering them
http://apidock.com/rails/ActionView/Helpers/TextHelper/concat
Upvotes: 3