This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Editing post</h1> | |
<% form_for :post , :url => blog_path(@post) , :html => {:method => :put} do |f| -%> | |
<%= f.error_messages %> | |
<div><%= f.text_field :subject %> | |
<div><%= f.text_area :content %></div> | |
<%= f.submit "Submit", :disable_with => 'Submiting...' %> | |
<% end -%> | |
<%= link_to 'Show', blog_path(blog) %> | | |
<%= link_to 'Back', blogss_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Editing post</h1> | |
<% form_for :post , :url => blog_path(@post) , :html => {:method => :put} do |f| -%> | |
<%= f.error_messages %> | |
<div><%= f.text_field :subject %> | |
<div><%= f.text_area :content %></div> | |
<%= f.submit "Submit", :disable_with => 'Submiting...' %> | |
<% end -%> | |
<%= link_to 'Show', blog_path(blog) %> | | |
<%= link_to 'Back', blogss_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BlogsController < ApplicationController | |
def index | |
@posts = Post.find(:all) | |
end | |
def show | |
@post = Post.find(params[:id]) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BlogsController < ApplicationController | |
def index | |
@posts = Post.find(:all) | |
end | |
def show | |
@post = Post.find(params[:id]) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1><%= @post.subject %></h1> | |
<div> | |
<%= @post.content %> | |
</div> | |
<%= link_to 'Edit', edit_blog_path(@post) %> | | |
<%= link_to 'Back', blogs_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1><%= @post.subject %></h1> | |
<div> | |
<%= @post.content %> | |
</div> | |
<%= link_to 'Edit', edit_blog_path(@post) %> | | |
<%= link_to 'Back', blogs_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dddddd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dddddd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ SELECT `db_tags`.`id`, `db_tags`.`name` FROM `db_tags` INNER JOIN `db_site_tags` ON (`db_tags`.`id` = `db_site_tags`.`tagid`) WHERE (`db_site_tags`.`db_site_id` = 1) GROUP BY `db_tags`.`id`, `db_tags`.`name` ORDER BY `db_tags`.`id` | |
~ SELECT `id`, `name`, `url`, `createtime` FROM `db_sites` WHERE (`id` = 1) ORDER BY `id` LIMIT 1 | |
~ SELECT `db_tags`.`id`, `db_tags`.`name` FROM `db_tags` INNER JOIN `db_site_tags` ON (`db_tags`.`id` = `db_site_tags`.`tagid`) WHERE (`db_site_tags`.`db_site_id` = 1) GROUP BY `db_tags`.`id`, `db_tags`.`name` ORDER BY `db_tags`.`id` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :dev do | |
desc "Rebuild system" | |
task :build => ["db:automigrate","db:create", "db:migrate", :fake ] | |
desc "create fake blog" | |
task :fake do | |
puts "fake blog" | |
DbSite.create!(:name => "DK's Blog", :url => "http://blog.gslin.org", :createtime => Time.now.to_i ) |