Showing posts with label sinatra. Show all posts
Showing posts with label sinatra. Show all posts

Tuesday, June 3, 2014

db problems with Sinatra

http://www.postgresql.org/docs/9.1/static/manage-ag-createdb.html

This worked for me.$ export DATABASE_URL=postgres://localhost/activerecord_sinatra

createdb --help
createdb creates a PostgreSQL database.

Usage:
  createdb [OPTION]... [DBNAME] [DESCRIPTION]

Options:
  -D, --tablespace=TABLESPACE  default tablespace for the database
  -e, --echo                   show the commands being sent to the server
  -E, --encoding=ENCODING      encoding for the database
  -l, --locale=LOCALE          locale settings for the database
      --lc-collate=LOCALE      LC_COLLATE setting for the database
      --lc-ctype=LOCALE        LC_CTYPE setting for the database
  -O, --owner=OWNER            database user to own the new database
  -T, --template=TEMPLATE      template database to copy
  --help                       show this help, then exit
  --version                    output version information, then exit

Connection options:
  -h, --host=HOSTNAME          database server host or socket directory
  -p, --port=PORT              database server port
  -U, --username=USERNAME      user name to connect as
  -w, --no-password            never prompt for password
  -W, --password               force password prompt

By default, a database with the same name as the current user is created.

Report bugs to <pgsql-bugs@postgresql.org>._adapters/postgresql_adapter.rb:891:in `rescue in connect': FATAL:  database

Tuesday, May 13, 2014

Sinatra

Sinatra Blog Tutorial
This is the tutorial Stephanie used to create our blog for RGSoC

Sinatra Tutorial Links from Tam
http://code.tutsplus.com/tutorials/singing-with-sinatra--net-18965Welcome to Track 1 of "Singing with Sinatra." In this mini-series we'll be taking a look at Sinatra; a small, yet incredibly powerful DSL for quickly creating Ruby web applications. In this part, we'll get started with Sinatra by playing around with a few routes, learning how to access URL parameters and how to POST data between pages.
http://code.tutsplus.com/tutorials/singing-with-sinatra-the-recall-app--net-19128Welcome to Track 2 of Singing with Sinatra.Today, we're going to extend our knowledge of Sinatra by building a small database-driven app, "Recall," for taking notes/making a to-do list.
http://code.tutsplus.com/tutorials/singing-with-sinatra-the-encore--net-19364Welcome back to Singing with Sinatra! In this third and final part we'll be extending the "Recall" app we built in the previous lesson. We're going to add an RSS feed to the app with the incredibly useful Builder gem, which makes creating XML files in Ruby a piece of cake. We'll learn just how easy Sinatra makes escaping HTML from user input to prevent XSS attacks, and we'll improve on some of the error handling code.
Other sites using markdown with sinatra
https://github.com/danmayer/resume 
http://www.danneu.com/posts/15-a-simple-blog-with-sinatra-and-active-record-some-useful-tools/