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 3975490
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:41:29+00:00 2026-05-20T04:41:29+00:00

I have a Rails 2.3 application. I currently have the following validations in my

  • 0

I have a Rails 2.3 application.

I currently have the following validations in my model:

validates_presence_of :jobno, :companyname

I have the following controller:

# POST /kases
# POST /kases.xml
  def create
    @company = Company.find(params[:kase][:company_id])
    @kase = @company.kases.create!(params[:kase])

    respond_to do |format|
        UserMailer.deliver_makeakase("EMAILADDRESS", "Highrise", @kase) if params[:sendtohighrise]
        UserMailer.deliver_makeakaseteam("EMAILADDRESS", "Highrise", @kase) if params[:notify_team_of_creation]
        @kase.delay.create_freeagent_project(current_user) if params[:send_to_freeagent]

        #flash[:notice] = 'Case was successfully created.'
        flash[:notice] = fading_flash_message("Case was successfully created.", 5)
    end  
        format.html { redirect_to(@kase) }
        format.xml  { render :xml => @kase, :status => :created, :location => @kase }
  end

So when you try and create a new record that doesn’t contain either a jobno or companyname I correctly get the following error message:

ActiveRecord::RecordInvalid in KasesController#create
Validation failed: {{errors}}

I have read about the recover ability, but I am unsure how/where to use it. I have read a few documents regarding the ability to rescue the content of the form. I am trying to make the form remain in place – with the entered content – but show an error on the form.

One of the documents I have read is here http://apidock.com/rails/ActiveRecord/RecordInvalid

I don’t want to log the error, simply inform the user what the problem was so they can try again.

Is this possible?

Thanks,

Danny

  • 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-20T04:41:30+00:00Added an answer on May 20, 2026 at 4:41 am
    def create
      @company = Company.find(params[:kase][:company_id])
      @kase = @company.kases.new(params[:kase])
    
      if @kase.save
        UserMailer.deliver_makeakase("EMAILADDRESS", "Highrise", @kase) if params[:sendtohighrise]
        UserMailer.deliver_makeakaseteam("EMAILADDRESS", "Highrise", @kase) if params[:notify_team_of_creation]
        @kase.delay.create_freeagent_project(current_user) if params[:send_to_freeagent]
        redirect_to @kase
      else  
        render :new
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have hostingrails.com. But following their tutorial on deploying rails application with FASTCGI
I currently have the following link_to in my Rails application: <%= link_to 'Remove this
I have Rails 3 application (running Rails RC1), and I have the following controller:
In the Rails application I’m currently developing I have many request models. We are
Background Currently, I am working on a Rails application. I have different products that
I have a rails 3.0.9 application that I am currently trying to deploy. The
In a rails application, I have a number of attributes for a model called
In my Rails project I currently have the following: = f.label :created_at_gteq = f.text_field
In my rails application I currently have a load of users who each have
Following this snippet , I have set-up in my rails application to highlight the

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.