Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6800831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:01:04+00:00 2026-05-26T19:01:04+00:00

I’ve got an issue where Rails is for some reason redirecting the new and

  • 0

I’ve got an issue where Rails is for some reason redirecting the new and edit methods to the home page, but the index and show methods are returned fine.

There is nothing special in the controller, or the routes, though I’ll include them below.

The error I’m getting is

Started GET "/recipes/new" for 192.168.5.46 at 2011-11-07 11:40:06 -0800
  Processing by RecipesController#new as HTML
Creating scope :page. Overwriting existing method Recipe.page.
  SQL (4.0ms)  SHOW TABLES
Creating scope :page. Overwriting existing method User.page.
  SQL (3.5ms)  SHOW TABLES
  User Load (1.1ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 2) LIMIT 1
  CACHE (0.1ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 2) LIMIT 1
Creating scope :page. Overwriting existing method RoleUser.page.
Creating scope :page. Overwriting existing method Role.page.
  Role Load (2.5ms)  SELECT `roles`.* FROM `roles` INNER JOIN `role_users` ON `roles`.id = `role_users`.role_id WHERE ((`role_users`.user_id = 2))
Completed   in 887ms
Redirected to http://localhost:3000

I’m assuming the problem is with this ‘overwriting’ bit, but I don’t know why it is attempting to do that, and then redirecting to home.

my recipes controller is

class RecipesController < ApplicationController
 load_and_authorize_resource
before_filter :require_user
respond_to :html, :js

  def index
    @recipes = Recipe.find_all_by_author_id(current_user.id)
  end

  def show
   @recipe = Recipe.find(params[:id])

  end

  def new
  return render :text =< 'new recipe'
    @recipe = Recipe.new

  end

  def create
    @recipe = Recipe.new(params[:recipe])
    @recipe.author_id=current_user.id
    if @recipe.save
      flash[:notice] = "Successfully created recipe."
      redirect_to @recipe
    else
      render :action =< 'new'
    end
  end
end

even the render text on new isn’t returning, it goes right to the redirect.

Any ideas why this might be happening and suggestions to resolve it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:01:05+00:00Added an answer on May 26, 2026 at 7:01 pm

    What in method :require_user?
    If you comment load_and_authorize_resource is it work?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.