spec/rails_app/app/controllers/posts_controller.rb in loaf-0.3.0 vs spec/rails_app/app/controllers/posts_controller.rb in loaf-0.4.0
- old
+ new
@@ -1,12 +1,23 @@
+class Post < Struct.new(:id); end
+
class PostsController < ApplicationController
- add_breadcrumb 'All Posts', :posts_path
+ breadcrumb 'Home', :root_path, only: :index
def index
+ breadcrumb 'All Posts', posts_path
end
+ def show
+ @post = ::Post.new(1)
+ end
+
def new
- add_breadcrumb 'New Post', 'new_post_path'
+ breadcrumb 'New Post', new_post_path
end
+ def create
+ breadcrumb 'New Post', new_post_path, force: true
+ render action: :new
+ end
end