Rails: Displaying pages navigation inside application layout -


i'm trying display page navigation rails in addiction page_title outputs record's informations inside brackets this:

- [#<page id: 1, page_title: "about", page_content: "about page content", created_at: "2013-05-04 06:38:03", updated_at: "2013-05-04 06:38:03">]  - other page [#....etc...] 

how can fix this? thx.

application.html.erb

<li>     <%= @pages.each |p| %>         <%= link_to page_path(p.id) %>             <%= p.page_title %>         <% end %>     <% end %>            </li> 

application_controller.rb

class applicationcontroller < actioncontroller::base     protect_from_forgery     before_filter :set_layout_variables      def set_layout_variables         @pages = page.all     end end 

remove = in line <%= @pages.each |p| %>

it should be

<li>     <% @pages.each |p| %>         <%= link_to page_path(p.id) %>             <%= p.page_title %>         <% end %>     <% end %>            </li> 

<%= output result of line (in case, loop), displays page record. that's why see record in output.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -