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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:18:10+00:00 2026-06-14T22:18:10+00:00

I have been having a problem with Rails lately where all the example code

  • 0

I have been having a problem with Rails lately where all the example code I’ve seen so far for sending data via POST is always routed to this default root URL which automatically calls a #create method in the controller. I wanted to know how do I go about making a form that sends data via POST but to a different method that I define?

In this particular example, I have a widget that needs to allow for file uploads. However, this upload could result in either a creation or a replace, but in either case it is only specific to this widget on the page. There are other widgets also capable of creating things and I need to keep the logic for them separated instead of just routing them all through some create method. How do I go about this?

  • 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-14T22:18:12+00:00Added an answer on June 14, 2026 at 10:18 pm

    This is how you make custom POST routes.

    In routes,

    resources :whatevers do
      member do
        post 'customizedpost'
      end
    end
    

    In your whatever controller

    def customizedpost
      # all the post stuff
    end
    

    And in your form for example

    = form_for @whatever, url: customizedpost_whatever_path, html: { method: :post } do |f|
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day everyone. I have been having the same problem all day at work
Im having a small problem with my code. I have been trying to read
I have been having this annoying problem when trying to implement a picture gallery
I have been having the following problem, i think it's probably due to the
EDIT I have finally figured out the problem i have been having on my
I am having a problem and have been banging my head aginst a wall...
I've been having a really weird problem. I have a mutable array that is
I have been having this problem for a few days now, and really cant
I have been having this problem for quite some time. I create a dataset
I have been having this problem wherein my threads stop execution and go into

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.