javascript - SyntaxError in BookmkfoldersController#index, unknown regexp options - dv -
i want make web application, , everything's been working fine far. however, actionview wrong. seems can't recognize closed html tags. every time sees closed parentheses, claims these unclosed. however, think are! i've posted error log below, knows what's going on...!
i following error :
syntaxerror in bookmkfolderscontroller#index app/views/bookmkfolders/index.html.erb:16: unknown regexp options - dv app/views/bookmkfolders/index.html.erb:17: syntax error, unexpected '<' and file index.html.erb
<ul class="board-canvas" data-update-url = "<%=sort_bookmkfolders_url %>"> <% @bookmkfolders.each |bookmkfolder| %> <div class="panel-wrapped"> <li id="<%=bookmkfolder.id%>" class="panel" style = "background-color:<%=bookmkfolder.bookmkfoldercolor%>"> <%= text_field_tag :test, "", class: 'thval' %> <h2 class= "panel-title" ><%= bookmkfolder.bookmkfoldertitle %></h2> <div class="panel-menu"> <%= button_tag "add bookmark-url", type: 'button', class: 'addfolder js-add-card' %> <div class="add-card-form"> <%= simple_form_for @bookmkfolder, remote: true, url: {action: "<%= @bookmkfolder.id %>"} |k| %> <%= k.input_field :bookmktitle, class: 'board-make-input', autocomplete: :off, autocorrect: :off, spellcheck: false, placeholder: 'add bookmark' %> <%= button_tag "save", type: 'submit' , class: 'save-button js-save-card' %> <%= button_tag "", type: 'button', class: 'delete-button' , "<span class="fa fa-times fa-1x" aria-hidden="true"></span>".html_safe %> <% end %> </div> # error message app/views/bookmkfolders/index.html.erb:16 </div> </li> <ul class="card-list"> <% bookmkfolder.@bookmks.each |bookmk| %> <li class ="card-item"> <%= link_to "","<%= bookmk.bookmktitle %>", class: 'card-link' %> <%= image_tag "#", class: 'card-thumbnail' %> <p class = "card-txt"><%= bookmk.bookmktitle%></p> </li> <%end%> </ul> </div> <%end%> </ul> and extracted sources bookmkfolders_controller.
def index @bookmkfolders = bookmkfolder.all @bookmkfolders = bookmkfolder.order("sequence") @bookmkfolder = bookmkfolder.new @bookmks = bookmk.all @bookmk = bookmk.new end def newfolder # redirect_to '/bookmkfolder/createfolder' end def createfolder colors = ['#c9ddff', '#c9ffdd', '#ffd2c9', '#c9caff', '#fdc9ff', '#fffdc9', '#c9fffc', '#ffc9c9', '#ffe5c9', '#eaffc9'] puts bookmkfolder.methods @bookmkfolder = bookmkfolder.new(bookmkfolder_params) @bookmkfolder.user = current_user @bookmkfolder.sequence = bookmkfolder.count + 1 @bookmkfolder.bookmkfoldercolor = colors.at(rand(colors.size)) respond_to |format| if @bookmkfolder.save format.html { redirect_to @bookmkfolder, notice: 'bookmkfolder created.' } format.js {} format.json { render :show, status: :created, location: @bookmkfolder } else format.html { render :new } format.json { render json: @bookmkfolder.errors, status: :unprocessable_entity } end end end
you can't nest <% %> this:
<%= simple_form_for @bookmkfolder, remote: true, url: {action: "<%= @bookmkfolder.id %>"} |k| %> once open <% using ruby, can use variables in code, so:
<%= simple_form_for @bookmkfolder, remote: true, url: { action: @bookmkfolder.id } |k| %> not related current error, notice second button_tag incorrect (aside using nested double quotes), can't pass argument trying "<span>...</span>".html_safe.
what looking pass block, this:
<div class="add-card-form"> <%= button_tag "", type: 'button', class: 'delete-button' %> <span class="fa fa-times fa-1x" aria-hidden="true"></span> <% end %> </div> you can read button_tag in the docs.
Comments
Post a Comment