monsoonco/Rails-Prismic

Name: Rails-Prismic

Owner: Monsoon

Description: Rails Prismic Experiment

Created: 2015-02-27 23:06:39.0

Updated: 2015-02-27 23:13:21.0

Pushed: 2015-02-27 23:13:20.0

Homepage: null

Size: 220

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Ruby on Rails starter project for prismic.io

This is a blank Rails project that will connect to any prismic.io repository, and trivially list its documents. It uses the prismic.io Ruby developement kit, and provides a few helpers to better use it with Rails.

Getting started
Launch the starter project

(Assuming you've installed the latest versions of Ruby, Rails and RubyGems.)

After forking and cloning the starter kit, it is immediately operational, so you can launch your rails server command. You may have to update your gems by running bundle install, but Rails will tell you about it if you must.

Configuring

By default, the starter kit uses the public API of the “Les Bonnes Choses” repository; its endpoint is https://lesbonneschoses.prismic.io/api. You may want to start by editing the config/prismic.yml file to make your Rails application use your own prismic.io repository.

To get the OAuth configuration working (and be able to preview your future content release, as well as to access your API if it's private), go to the Applications panel in your repository settings, and create an OAuth application to allow interactive sign-in. Fill the application name and the callback URL (localhost URLs are always authorized, so at development time you can omit to fill the Callback URL field), and copy/paste the clientId & clientSecret tokens into the config/prismic.yml file.

You may have to restart your Rails server.

Get started with prismic.io

You can find out how to get started with prismic.io on our prismic.io developer's portal.

Understand the Ruby development kit

You'll find more information about how to use the development kit included in this starter project, by reading its README file.

Specifics and helpers of the Rails starter project

There are several places in this project where you'll be able to find helpful helpers of many kinds. You may want to learn about them in order to know your starter project better, or to take those that you think might be useful to you in order to integrate prismic.io in an existing app.

Other technical operations
Work with a local database

You don't actually need a database to run this starter project, as prismic.io handles everything for you (content, users, …); if your website is all about content, you may never even need a database at all! Therefore, our starter project comes without ActiveRecord (the part of Rails that handles the connection with databases, and the model tier)

However, if your project offers other features than displaying content, you may need to store and retrieve non-content data from a local database. Here's how you put ActiveRecord back in your Rails starter project:

Deploying your application

This starter project is immediately deployable on most hosting platforms that are compatible with Rails 4. To deploy it on Heroku, simply create a Heroku account, install the Heroku Toolbelt, and log into it by running heroku login in your terminal.

Then, go to your project's directory in your terminal, and run:

ku create
push heroku master

Now your site is live for the world to see!

Contribute to the starter project

Contribution is open to all developer levels, read our “Contribute to the official kits” documentation to learn more.

Licence

This software is licensed under the Apache 2 license, quoted below.

Copyright 2013 Zengularity (http://www.zengularity.com).

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.