/rails4blog

A super simple rails blog app with front-end and protected admin area with fully functioning CRUD

Primary LanguageRuby

README

1) rails new webapp

2) rails g scaffold post title:string content:text

3) rake db:migrate

4) show sqlite database in firefox

5) go to localhost:3000/posts and create a new post, refresh database

6) clean up code

7) add

gem ‘activeadmin’, github: “gregbell/active_admin”

to Gemfile

8) run ‘bundle’

9) run ‘rails generate active_admin:install’

10) rake db:migrate

11) open localhost:3000/admin

12) run ‘rails console’

13) create AdminUser in console

14) AdminUser.create :email => ‘test@test.com’, :password => ‘test1234’

15) login in admin >> localhost:3000/admin

16) add file app/admin/posts.rb

17) go to localhost:3000/admin/posts and look around ;)

18) Make the posts#index action to be the default for root

19) look at localhost:3000/

done!

Screenshots

Index page

Admin Login

Admin Area

Creating a new post

Just created a new post

Ediding post

Disclaimer

For example purposes.