Sha256: 99e1cff99636d12fba016d20e8b04f5420466d7b14c075a42cd472b7ac72a5b1

Contents?: true

Size: 393 Bytes

Versions: 16

Compression:

Stored size: 393 Bytes

Contents

class BlogsController < InheritedResources::Base 
  load_and_authorize_resource
  
  def index
    @blogs = Blog.find(:all,:order=>'created_at desc')
  end
    
  def create
    @blog = Blog.new(params[:blog])
    @blog.user =current_user
    if @blog.save
      flash[:notice] = "Successfully created blog."
      redirect_to @blog
    else
      render :action => 'new'
    end
  end
  
end

Version data entries

16 entries across 8 versions & 1 rubygems

Version Path
squeezer-0.2.1 lib/generators/squeezer/templates/app/controllers/blogs_controller.rb
squeezer-0.2.1 app/controllers/blogs_controller.rb
squeezer-0.2.0 lib/generators/squeezer/templates/app/controllers/blogs_controller.rb
squeezer-0.2.0 app/controllers/blogs_controller.rb
squeezer-0.1.11 app/controllers/blogs_controller.rb
squeezer-0.1.11 lib/generators/squeezer/templates/app/controllers/blogs_controller.rb
squeezer-0.1.7 app/controllers/blogs_controller.rb
squeezer-0.1.7 lib/generators/squeezer/templates/app/controllers/blogs_controller.rb
squeezer-0.1.6 app/controllers/blogs_controller.rb
squeezer-0.1.6 lib/generators/squeezer/templates/app/controllers/blogs_controller.rb
squeezer-0.1.5 app/controllers/blogs_controller.rb
squeezer-0.1.5 lib/generators/squeezer/templates/app/controllers/blogs_controller.rb
squeezer-0.1.4 lib/generators/squeezer/templates/app/controllers/blogs_controller.rb
squeezer-0.1.4 app/controllers/blogs_controller.rb
squeezer-0.1.3 lib/blogs_controller.rb
squeezer-0.1.3 lib/app/controllers/blogs_controller.rb