Skip to content

Instantly share code, notes, and snippets.

@akinsgre
Created September 13, 2012 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akinsgre/3715021 to your computer and use it in GitHub Desktop.
Save akinsgre/3715021 to your computer and use it in GitHub Desktop.
Type error
def update
@channel = current_user.channels.find(params[:id])
# make sure channel isn't social
#render :text => '' and return if @channel.social
if params["channel"]["video_type"].blank? && !params["channel"]["video_id"].blank?
@channel.errors.add(:base, t(:channel_video_type_blank))
end
if @channel.errors.count <= 0
puts "########## Params #{params.inspect}"
@channel.save_tags(params[:tags][:name])
@channel.update_attributes(params[:channel])
else
session[:errors] = @channel.errors
redirect_to channel_path(@channel.id, :anchor => "channelsettings") and return
end
flash[:notice] = t(:channel_update_success)
redirect_to channel_path(@channel.id)
end
it "should allow a channel to be edited" do
@channel.public_flag = true
puts "###### tags = #{@tag} "
put :update, :id => @channel.id, :channel => @channel, :tags => @tag
response.should redirect_to channel_path(@channel.id)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment