Topic: Rails for Zombies need help

Has anyone completed this tutorial on rails. I am currently stuck on lab 4 exercise 4.
http://railsforzombies.org/labs/4/exercises/21

Re: Rails for Zombies need help

class ZombiesController < ApplicationController
  before_filter :find_zombie, :has_tweets

  def show
    render :action => :show
  end

  def find_zombie
    @zombie = Zombie.find params[:id]
  end
  
  def has_tweets
    @zombie = Zombie.find params[:id]
    if @zombie.tweets.blank?
      redirect_to zombie_path(@zombie)
    end
  end
  
end

Last edited by kaleemullah (2011-01-10 14:50:16)

Re: Rails for Zombies need help

Hello thank you for your time. I put your code in and it comes up with the error "Did not redirect, last response status was 200"

Re: Rails for Zombies need help

Hey I would like to retract my previous statement. Your code actually did work. I mistakenly put redirect_path instead of redirect_to. I think thats why my code never worked. Thank you for your help!