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]