render - How can I iterate through Alchemy CMS elements in Rails View? -
i trying iterate on element called vacation_date. however, maintain getting error:
undefined local variable or method `element' #<#:0x007fa394a33948>
<h2 class="no-margin-top">vacation dates</h2> <%= render_elements :only => [:vacation_date] %> <ul> <% element.tag_list.each |tag| %> <li><%= tag.name %></li> <% end %> </ul>
how can iterate on element in html.erb file? can render of elements calling just
<%= render_elements :only => [:vacation_date] %>
and deleting rest of code. however, id able iterate on holiday dates.
use render_element
it's described here https://github.com/magiclabs/alchemy_cms/blob/b712ac2fc9fdc3cb6786b1c6733f8d37be4c2588/app/helpers/alchemy/elements_helper.rb#l98-l172
ruby-on-rails render alchemyapi
No comments:
Post a Comment