Merge branch 'master' of github.com:iobridge/thingspeak

This commit is contained in:
Lee Lawlor
2015-03-19 11:33:25 -04:00
4 changed files with 34 additions and 44 deletions

View File

@ -154,7 +154,13 @@ class ChannelsController < ApplicationController
end
def show
@channel = Channel.find(params[:id]) if params[:id]
@channel = Channel.find_by_id(params[:id])
# show the public show page if no channel found
if @channel.blank?
@channel = Channel.new(public_flag: false, name: "Channel #{params[:id]}", id: params[:id])
render "public_show" and return
end
@title = @channel.name
@domain = domain
@ -369,6 +375,12 @@ class ChannelsController < ApplicationController
if channel.save && feed.save
status = entry_id
# queue reacts, but don't cause an error
begin
channel.queue_react
rescue
end
# check for tweet
if params[:twitter] && params[:tweet]
# check username

View File

@ -26,9 +26,6 @@ class Feed < ActiveRecord::Base
extend FeedHelper
belongs_to :channel
after_commit :queue_react
delegate :queue_react, :to => :channel
self.include_root_in_json = false
attr_readonly :created_at
@ -156,4 +153,3 @@ class Feed < ActiveRecord::Base
end
end

View File

@ -2,6 +2,7 @@
<ol class="breadcrumb">
<%# g1199258 %>
<li><%= link_to t(:channels), auth_channels_path %></li>
<li class="active"><%= @channel.name %></li>
<li class="active"><%= @channel.public? ? @channel.name : "Channel #{@channel.id}" %></li>
</ol>
</div>