views:

54

answers:

1

I scaffolded a test app and got a Routing error when I put an iFrame inside my view:

This is the show template where I added the iFrame:

views/bars/show.html.erb:

<p>
  <b>Body:</b>
  <%=h @bar.body %>
</p>

<iframe src=“http://www.yahoo.com” style=“width:500px; height:500px;” frameborder=“0?></iframe>


<%= link_to 'Edit', edit_bar_path(@bar) %> |
<%= link_to 'Back', bars_path %>

I'm calling the page like this:

http://localhost:3000/bars/1

The page displays correctly. But the iFrame inside the page says this:

Routing Error

No route matches "/bars/%E2%80%9Chttp://www.yahoo.com%E2%80%9D" 
with {:method=>:get}

I didn't make any changes to routes.rb from the defaults:

ActionController::Routing::Routes.draw do |map|
  map.resources :bars
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end
+1  A: 

You're not using the right double quote character, which is "

mickael9
You probably copied it somewhere of the internets
nasmorn
Thanks, that fixed it. Yes, I copied some code off a webpage. I don't know why it copied like that.
toma