タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

tutorialに関するu-ichiのブックマーク (2)

  • merb wiki for japanese - my_first_blog

    このページでは"My First Blog [Merb Wiki]"を元に、とても簡単なブログアプリを作成する。このサンプルでmerbでは一対多の関係をどのように実現するかを理解するきっかけとなれば幸いである。 サンプルは*NIXで操作する事を想定して記述する。Windowsで行う場合、適正読み替えること。 ジェネレート merb-genコマンドでblogという名称のアプリケーションを生成する。 $ merb-gen app blog Generating with app generator: [ADDED] gems [ADDED] Rakefile [ADDED] app/views/exceptions/not_found.html.erb [ADDED] app/views/exceptions/not_acceptable.html.erb [ADDED] app/models

  • My First Blog [Merb Wiki]

    In app/models/post.rb add the folowing: class Post ... snipp ... has n, :comments end and in app/models/comment.rb add: class Comment ... snipp ... belongs_to :post end Edit new.html.haml to look like this: = error_messages_for :post = form_for(@post, :action => url(:posts) ) do = partial :form %p= submit "Create" = link_to 'Back', url(:posts) Edit edit.html.haml to look like this: = error_message

  • 1