don't show 404 page for channels that don't exist
This commit is contained in:
parent
87c2cf1b53
commit
19ae3343cb
@ -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
|
||||
@ -609,3 +615,4 @@ class ChannelsController < ApplicationController
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user