RailsCasts Pro episodes are now free!

Learn more or hide this

Keith Ryu's Profile

GitHub User: kibaekr

Comments by Keith Ryu

Avatar

The history feature isn't working for me. I've done exactly as the tutorial has done but I get the following error when I try accessing the old url after editing it to a new url:

"Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return"."

def show

@track = Track.find(params[:id])

if request.path != track_path(@track)
 redirect_to @track, status: :moved_permanently
end

@profileimg = @track.author.image_url(:thumb).to_s
if (@track.active != true) && (@track.author != current_user) 
  redirect_to tracks_url, alert: 'The track you were trying to view was not published yet (still in draft) and you are not the author.' 
else 
  @mission = @track.missions.order("position ASC")  
  @comment = @track.track_comments

  count_hits()    
  respond_to do |format|
    format.html #show.html.erb
    format.json { render json: @track }
  end
end
end
Avatar

I figured this out. I posted an answer to my own question - see if this helps:http://stackoverflow.com/questions/11240756/facebook-authentication-with-devise-omniauth-facebook-not-doing-anything/11256425#11256425

Basically, I forgot to add it to the attr_accessible on the User model, and I also had to unchange the changes I made to the after_sign_in_path_for method that devise comes along with. And also, dont forget to create a migration to add the columns provider and uid to the user table.

Avatar

+1 I'm having the same problem of facebook keep adding the #=_. I looked it up and i t seemed like that was intentionally done to indicate that nothing has happened.

@supriya surve, i'm guessing everyone here that's having a problem has already gone through the docs there. I certainly have (read it multiple times), but still can't figure out what the problem is.