show error message on chart if channel not found
This commit is contained in:
parent
4f05d39cfb
commit
0260e5209a
@ -5,7 +5,7 @@ class FeedController < ApplicationController
|
||||
|
||||
def index
|
||||
feed_factory = FeedFactory.new(params)
|
||||
channel = Channel.find(params[:channel_id])
|
||||
channel = feed_factory.channel
|
||||
api_key = ApiKey.find_by_api_key(get_apikey)
|
||||
@success = channel_permission?(channel, api_key)
|
||||
|
||||
|
@ -18,7 +18,7 @@ class FeedFactory < ApplicationController
|
||||
end
|
||||
|
||||
# attributes that can be read
|
||||
attr_reader :feeds, :daily_feeds, :limit, :use_daily_feed, :feed_select_options, :cache_feeds
|
||||
attr_reader :feeds, :daily_feeds, :limit, :use_daily_feed, :feed_select_options, :cache_feeds, :channel
|
||||
|
||||
# calculate the limit that should be used
|
||||
def calculate_limit
|
||||
|
@ -185,7 +185,12 @@
|
||||
// draw the chart
|
||||
var dynamicChart = new Highcharts.Chart(chartOptions);
|
||||
|
||||
}); // end getJSON ajax call
|
||||
// end getJSON success
|
||||
})
|
||||
// chained to getjson, on error
|
||||
.error(function() {
|
||||
$('#chart-container').html('Invalid Channel.');
|
||||
});
|
||||
|
||||
}); // end document.ready
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user