Code Monkey home page Code Monkey logo

ruby-live-blog's Introduction

Live Blog App with Pusher + Cloudinary + Ruby

Demo

Link to article

Getting Started

Clone The Repository

$ git clone https://github.com/oreHGA/ruby-live-blog.git

Change directory

$ cd ruby-live-blog

Install dependencies

$ bundle install

Setup up database

$ rails db:setup

$ rails db:migrate

Download Cloudinary config file here and put file in the config/ directory

Obtain Pusher credentials here and update the config/initializers/pusher.rb file.

Run the app

$ rails server

Prerequisites

  • A basic knowledge of Ruby

Built With

  • Pusher - A Ruby gem to interact with the Pusher REST API
  • Cloudinary - Cloudinary is a media management platform for web and mobile developers

ruby-live-blog's People

Contributors

orehga avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ruby-live-blog's Issues

"Must supply Cloudinary API key" in post_controller

Foloowing the instructions here and have all the files written out but I get the following error when I store the post.

must supply api_key

On the blog I can't find any reference to an API key. I see it in my cloudinary.yml file and that's saved in the config directory.

The home and create pages work but they're all empty since I can't actually store anything.

Here's my code for the postcontroller as well just in case it is a syntax error.

`class PostController < ApplicationController
def create
end

def store
#upload image to cloudinary
@image = Cloudinary::Uploader.upload(params[:media])
#create a new post object and save to db
@post = Post.net({:title => params[:title], :text => params[:text], :author => params[:author], :media => @image['secure_url']})
@post.save
#trigger an event with pusher
if @post.save
# broadcasting posts using pusher
Pusher.trigger('posts-channel','new-post', {
id: @post.id,
title: @post.title,
media: @post.media,
body: @post.body
})
end
redirect_to('/')
end
end
`
I have the secure URL pasted in the actual file.

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.