orehga / ruby-live-blog Goto Github PK
View Code? Open in Web Editor NEWThis is a simple application showing how to create a live blog with Ruby and Pusher Channels
This is a simple application showing how to create a live blog with Ruby and Pusher Channels
Foloowing the instructions here and have all the files written out but I get the following error when I store the post.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.