29. namespace(:nodes) do
desc quot;Purge inactive nodes.quot;
task :purge => [:merb_env] do
Node.inactive.purge
end
desc quot;Scan for nodesquot;
task :scan => [:merb_env] do
Node.detach_and_scan(Node.first)
end
end
48. class Posts < Application
1. provides :json
def show
@post = Post.get(params[:id])
2. display @post
end
end
49. respond_to do |format|
format.html { render }
format.json { @post.to_json }
end
Rails
vs
case content_type Merb
when :html
render
when :json
display @post
end