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

  • SEARCH
  • Home
  • 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 9211861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:23:35+00:00 2026-06-18T01:23:35+00:00

am new whit ruby, have this exception Routing Error uninitialized constant i do everything

  • 0

am new whit ruby, have this exception
Routing Error
uninitialized constant
i do everything that in this forum said , but dosent work

this is my db

class CreateCredits < ActiveRecord::Migration

  def change

create_table :credits do |t|

  t.string :type

  t.float :amaunt

  t.date :creditdate

  t.date :expiredate

  t.decimal :rake

  t.string :waranty


  t.timestamps
end   end end

this mi controller class is defined like this:

class CreditsController < ApplicationController


  # GET /credits


 # GET /credits.json

def index
@credits = Credit.all

  respond_to do |format|
  format.html # index.html.erb
  format.json { render json: @credits }
   end
end

 # GET /credits/1
 # GET /credits/1.json
 def show
   @credit = Credit.find(params[:id])

    respond_to do |format|
    format.html # show.html.erb
      format.json { render json: @credit }
   end
end

  # GET /credits/new
 # GET /credits/new.json
 def new
   @credit = Credit.new

   respond_to do |format|
    format.html # new.html.erb
    format.json { render json: @credit }
 end
end

# GET /credits/1/edit
def edit
  @credit = Credit.find(params[:id])
end

# POST /credits
 # POST /credits.json
 def create
  @credit = Credit.new(params[:credit])

respond_to do |format|
  if @credit.save
    format.html { redirect_to @credit, notice: 'Credit was successfully created.' }
    format.json { render json: @credit, status: :created, location: @credit }
  else
    format.html { render action: "new" }
    format.json { render json: @credit.errors, status: :unprocessable_entity }
     end
   end
 end

  # PUT /credits/1
  # PUT /credits/1.json
 def update
@credit = Credit.find(params[:id])

respond_to do |format|
  if @credit.update_attributes(params[:credit])
    format.html { redirect_to @credit, notice: 'Credit was successfully updated.' }
    format.json { head :no_content }
  else
    format.html { render action: "edit" }
    format.json { render json: @credit.errors, status: :unprocessable_entity }
      end
    end
   end

    # DELETE /credits/1
  # DELETE /credits/1.json
  def destroy
@credit = Credit.find(params[:id])
@credit.destroy

 respond_to do |format|
  format.html { redirect_to credits_url }
  format.json { head :no_content }
  end
  end
end

and this is my route
Defining this route as a scope instead of a namespace, didn’t work aswell.

 Insolvencia::Application.routes.draw do

  resources :Credit
  get "credit" => "credit#index"
  root :to => 'credit#index'
   match "credit", :to => "credit#index"
 end
  • 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-06-18T01:23:36+00:00Added an answer on June 18, 2026 at 1:23 am

    It should be resources :credits instead of resources :Credit

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

Sidebar

Related Questions

I have a Custom usercontrol that I want to enlarge. I tested this whit
New to PHP and MySQL, have heard amazing things about this website from Leo
New to spring. I'm getting the following exception being caught: 2012-06-14 16:20:57,719 [http-8080-6] ERROR
im starting whit Nhibernate and have managed to get a few examples working, but
I have a thread, whit a for-loop that is going through a object of
(New to Objective-C, but well versed in C/C++). Presently I have an Objective-C class
I got 2 diferents message but whit the same error, Im using a devise
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
I'm low level as3 programmer and I need help whit this code: I have
new to ruby, and rails... but not to the amp stack. my preferred method

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.