Commit ef38b17f by tady

create controller flow, stock

parent 248183a5
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
// Place all the styles related to the flow controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the stock controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
class FlowController < ApplicationController
before_action :require_login
def show
@posts = Post.order(updated_at: :desc).limit(20)
end
end
class StockController < ApplicationController
before_action :require_login
def show
end
end
class FlowDecorator < Draper::Decorator
delegate_all
# Define presentation-specific methods here. Helpers are accessed through
# `helpers` (aka `h`). You can override attributes, for example:
#
# def created_at
# helpers.content_tag :span, class: 'time' do
# object.created_at.strftime("%a %m/%d/%y")
# end
# end
end
class StockDecorator < Draper::Decorator
delegate_all
# Define presentation-specific methods here. Helpers are accessed through
# `helpers` (aka `h`). You can override attributes, for example:
#
# def created_at
# helpers.content_tag :span, class: 'time' do
# object.created_at.strftime("%a %m/%d/%y")
# end
# end
end
module FlowHelper
end
module StockHelper
end
/! view:flow/show
.row
.col-xs-8 role="navigation"
#tab-list.tab-pane.active
.list-group
- @posts.each_with_index do |post, i|
a.list-group-item.post-list data-post-id=post.id href="#" = post.title
.col-xs-4
#list_post
p#posts-placeholder style="color:#aaa;font-size:30px" &lt;-- Select a post...
<h1>Stock#show</h1>
<p>Find me in app/views/stock/show.html.erb</p>
......@@ -5,6 +5,9 @@ Rendezvous::Application.routes.draw do
root 'home#top', as: 'root'
get 'stock' => 'stock#show', as: 'stock'
get 'flow' => 'flow#show', as: 'flow'
get 'posts/:id/fork' => 'posts#fork', as: 'fork_post'
post 'posts/:id/mail' => 'posts#mail', as: 'mail_post'
post 'posts/:id/comment' => 'posts#comment', as: 'comment_post'
......
require 'spec_helper'
describe FlowController do
describe "GET 'show'" do
it "returns http success" do
get 'show'
response.should be_success
end
end
end
require 'spec_helper'
describe StockController do
describe "GET 'show'" do
it "returns http success" do
get 'show'
response.should be_success
end
end
end
require 'spec_helper'
describe FlowDecorator do
end
require 'spec_helper'
describe StockDecorator do
end
require 'spec_helper'
# Specs in this file have access to a helper object that includes
# the FlowHelper. For example:
#
# describe FlowHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
describe FlowHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
require 'spec_helper'
# Specs in this file have access to a helper object that includes
# the StockHelper. For example:
#
# describe StockHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
describe StockHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
require 'spec_helper'
describe "flow/show.html.erb" do
pending "add some examples to (or delete) #{__FILE__}"
end
require 'spec_helper'
describe "stock/show.html.erb" do
pending "add some examples to (or delete) #{__FILE__}"
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment