|
Space Map
|
Ruby on Rails의 기본 디렉토리 구조화면 캡쳐 필요함. Ruby on Rails의 MVC 기본 아키텍처Agile Web Development 12 페이지 그림 2.1 각 Layer별 pseudo 코드Modelcontact.rb class Contact < ActiveRecord::Base end
Controllermytest_controller.rb class MyTestController < ApplicationController
def index
render_text "Hello World!"
end
end
View
app/views/modulename/methodName.rhtml <html> <head> <title>All Recipes</title> </head> <body> <h1>Online Cookbook - All Recipes</h1> <table border="1"> <tr> <td width="80%"><p align="center"><i><b>Recipe</b></i></td> <td width="20%"><p align="center"><i><b>Date</b></i></td> </tr> <% @recipes.each do |recipe| %> <tr> <td><%= link_to recipe.title, :action => "show", :id => recipe.id %></td> <td><%= recipe.date %></td> </tr> <% end %> </table> <p><%= link_to "Create new recipe", :action => "new" %></p> </body> </html>
참고문서
|
|
Add Comment