Eduardo Oliveira Almeida
2013-Jun-04 22:54 UTC
Open new page with rails link_to and bootstrap modal
I''m having some problem to load a new page in a modal with bootstrap on Rails. Here is the important part on my eventos/index.html.erb <div id="content"> <% @eventos.each do |evento| %> <!--Bar 2--> <div class="mosaic-block bar2"> **<%= link_to(evento, :class=>"mosaic-overlay", :id => "evento" , "data-toggle" => "modal", ''data-target'' => ''#eventoModal'') do %>** <div class="details"> <h4><%= evento.local %> - <%= evento.data.to_time.strftime(''%e/%m'') %></h4> <h4>Mais+</h4> </div> <%end%> <div class="mosaic-backdrop"><%= image_tag evento.attachment.url(:small) %></div> </div> <% end %> As you can see there is a link_to to my "evento" (rendered html: a href="/eventos/1" class="mosaic-overlay" data-target="#eventoModal" data-toggle="modal" id="evento" But when I click the link, nothing happens (before add the modal it was working) Here is evento/show.html.erb <div class="modal" id="eventoModal"> <p>Some code</p></div> and finally on my assets/javascripts/eventos.js.coffe I have this: $(''#eventoModal'').modal(options) Anyone can help me show the evento/show.html.erb in a modal on the evento/index.html.erb page? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2d77cdf4-a297-4882-899a-a528b60f76b1%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.