So I'm writing a helper to help me fill out the carousel of bootstrap for Rails. This is the piece of code of the helper method:
def carousel_item(element, active = false)
content_tag :div, class:"item"+(active ? " active" : "") do
image_tag("carousel/"+element.name) +
if !element.desc.nil? || !element.title.nil? || !element.link.nil? do
content_tag(:div, {class:'container'}) do
!element.title.nil? ? content_tag(:h1, element.title) +
!element.desc.nil? ? content_tag(:p, element.desc, class:"lead") +
!element.link.nil? ? link_to(element.linktitle, url_for(action: element.link), {class:"btn btn-large btn-primary"}) +
end
end
end
end
But then im getting this error:
app/helpers/application_helper.rb:22: syntax error, unexpected keyword_end, expecting ':'
pointing after the last end prior closing the method.. hours fighting against this thing, still can't find the solution.