Git Product home page Git Product logo

sinatra-blog's Introduction

yo!

This is just a simple blog, which uses Sinatra + PostgreSQL + Heroku + ActiveRecord + Tux + Bootstrap: http://sinatra-sings.herokuapp.com/

Want to view the tutorial on how I built it?
  • Yes? View the tutorial on my blog (upated may 4, 2013); check out how to add a captcha
  • No ...
Well, at the very least, download the app and add some features (editing/deleting posts, user login/logout/authentication)
$ git clone https://github.com/mjhea0/sinatra-blog
$ cd sinatra-blog
$ bundle install
$ ruby app.rb                 

Then open http://localhost:4567/

Fork. Star. Applaud. Build.

sinatra-blog's People

Contributors

mjhea0 avatar yang70 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sinatra-blog's Issues

Split the app.rb in different files

Hi,
I know this is an example, and as an example - should be a good one.

Feel free to not follow what I'm going to say, it's my personal opinion.

I think you should:

  • Create a folder for Post Model
  • Another one for the helpers
  • And a folder for your post controller
  • And your endpoint /posts/create should be "/posts/new" which is exactly what you have inside.

Thanks for the example.
David

Make sure that the adapter in config/database.yml is valid

Hi, when I start the app locally, I get this error. Can you help me understand what format of data should be in the config/database.yml file? I don't see one checked into the repo. Thanks!

➜  sinatra-blog git:(master) ✗ ruby app.rb 
/Users/me/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:in `require': Could not load 'active_record/connection_adapters/sqlite_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (LoadError)

I am using ruby 2.4.1 instead of 1.9.3 as specified in the Gemfile because I get exceptions from rvm when I try to install 1.9.3 on my system.

ruby-1.9.3-p551 - #configuring - please wait
Error running './configure --prefix=/Users/me/.rvm/rubies/ruby-1.9.3-p551  --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared',
please read /Users/me/.rvm/log/1507826206_ruby-1.9.3-p551/configure.log
There has been an error while running configure. Halting the installation.
➜  sinatra-blog git:(master) ✗ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.