RAILS - Link to ‘action’

ProjectController

[code="ruby"]
class ProjectController < ApplicationController
def index
@p=Project.find(:all);
end
end
[/code]

indexView

[code="ruby"]

Project#index

    <% @p.each do |p| %>

  • <%= link_to p.name_th , {:action => ’show’,:id=>p.id}%>
  • <%= p.name_eng %>
  • <%= p.description %>

  • <% end %>

[/code]

Tags: ,

This entry was posted on Sunday, February 8th, 2009 at 2:55 am and is filed under rails. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply