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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:57:59+00:00 2026-05-20T17:57:59+00:00

I have the following code in my controller: # GET /kases/1/edit def edit @kase

  • 0

I have the following code in my controller:

  # GET /kases/1/edit
  def edit 
    @kase = Kase.find(params[:id])
    respond_to do |format|
      format.html { render :layout => 'kaseshow'} # show.html.erb
      format.xml  { render :xml => @kase }
      format.pdf { render :layout => false }
    end 
  end

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

    if @kase.save
        UserMailer.deliver_makeakase("xxxxxx@xxxxxxxx.com", "Highrise", @kase) if params[:sendtohighrise]
        UserMailer.deliver_makeakaseteam("xxxxxxxx@xxxxxxx.co.uk", "Highrise", @kase) if params[:notify_team_of_creation]
        @kase.create_freeagent_project(current_user) if params[:send_to_freeagent]

        redirect_to(@kase)

        #flash[:notice] = 'Case was successfully created.'
        flash[:notice] = fading_flash_message("Case was successfully created.", 5)
      else
        render :new
      end        
  end

I am trying to make it so if the user edits a case and then selects the Send to Freeagent tickbox:

@kase.create_freeagent_project(current_user) if params[:send_to_freeagent]

then the case is resent to Freeagent (online accounting software). I’m not worried about dealing with duplicates because if the case already exists in Freeagent then the user won’t need to resend it.

Is this possible?

  • 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-20T17:58:00+00:00Added an answer on May 20, 2026 at 5:58 pm

    Where is your ‘update’ method? The edit is only called when you are loading the data and rendering the page the user will see to edit the record. When save/update/submit is clicked on that page, it should be calling the ‘update’ method in the controller. So, you should be able to put that same line into the ‘update’ method in the true condition of the if block that looks something like this:

    if @kase.update_attributes(params[:kase])
        #your code would go here
        @kase.create_freeagent_project(current_user) if params[:send_to_freeagent]
        #the rest of the code would go here
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following controller code: def create @admin = Admin.new(params[:admin]) respond_to do |format|
I have the following code in a view: def controller_details(request, object_id): controller = Controller.objects.get(pk=object_id)
I have the following code in my controller def create @severity = Severity.new(params[:severity]) if
I have the following gsp page: <g:def var=incidentMngmntId value=${incidentMngmntInstance?.id}/> <g:link controller=ticketMngmnt action=list params=[incidentMngmntId :
I have the following code var test; $.ajax({ type: "GET", url: "../views/person/controller.php?actor=person&action=checkAge", data: "age="
I have the following code: $.ajax({ type: GET, url: /Search/GetNewData //Controller/ActionMethod ---snip--- )}; This
In my controller/request-handler, I have the following code: def monkey(self, **kwargs): cherrypy.response.headers['Content-Type'] = application/json
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have the following code in my controller: public ActionResult Details(int id) { var
I have a controller class as in the following code segment: @Controller public class

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.