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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:21:47+00:00 2026-06-05T15:21:47+00:00

I want to build a form_tag that will allow me to post a new

  • 0

I want to build a form_tag that will allow me to post a new note to a client. My rake routes look like:

[hchq (master)]$ rake routes
    user_notes GET    /users/:user_id/notes(.:format)          notes#index
               POST   /users/:user_id/notes(.:format)          notes#create
 new_user_note GET    /users/:user_id/notes/new(.:format)      notes#new
edit_user_note GET    /users/:user_id/notes/:id/edit(.:format) notes#edit
     user_note GET    /users/:user_id/notes/:id(.:format)      notes#show
               PUT    /users/:user_id/notes/:id(.:format)      notes#update
               DELETE /users/:user_id/notes/:id(.:format)      notes#destroy
         users GET    /users(.:format)                         users#index
               POST   /users(.:format)                         users#create
      new_user GET    /users/new(.:format)                     users#new
     edit_user GET    /users/:id/edit(.:format)                users#edit
          user GET    /users/:id(.:format)                     users#show
               PUT    /users/:id(.:format)                     users#update
               DELETE /users/:id(.:format)                     users#destroy
      sessions POST   /sessions(.:format)                      sessions#create
   new_session GET    /sessions/new(.:format)                  sessions#new
       session DELETE /sessions/:id(.:format)                  sessions#destroy
       clients GET    /clients(.:format)                       clients#index
               POST   /clients(.:format)                       clients#create
    new_client GET    /clients/new(.:format)                   clients#new
   edit_client GET    /clients/:id/edit(.:format)              clients#edit
        client GET    /clients/:id(.:format)                   clients#show
               PUT    /clients/:id(.:format)                   clients#update
               DELETE /clients/:id(.:format)                   clients#destroy
          root        /                                        clients#index
        signup        /signup(.:format)                        users#new
        signin        /signin(.:format)                        sessions#new
       signout DELETE /signout(.:format)                       sessions#destroy

Can I just post to the create action on the notes or do I need to get the new_user_note_path? Why? I have an at @client instance variable available in the controller.

This is what I currently have:

<%= form_tag(new_user_note_path, method: :get) do |f| %>
    <%= render 'shared/error_messages', object: f.object %> 
    <div class="field">
        <%= f.text_area :content, placeholder: "Compose new note" %> 
    </div>
<%= f.submit "New Note"%> 
<% end %>

Which gets me this error:

enter image description here

What I think needs to happen is I need to build a form_tag that either hits the create or new_user_note action of the controller. I think it needs to hit the new_user_note, now that I think about it more so that it can set the client id. Is this correct?

If so how do I structure my form_tag? Do I need to pass a hidden field with a client_id?

Also, what should my notes controller look like in regard to the new and create action?

  • 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-05T15:21:48+00:00Added an answer on June 5, 2026 at 3:21 pm
    1. Since user is a resource, your should :post to users_notes_path, which will be handled by notes#create, as it is meant to be for resources
    2. Again, since user is a resource, why not user form_for ? (or simpleform/formtastic/whated suits you) ?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a system using Django that will allow users to build
I'm trying to build a form that will list all users and allow you
I'm a newcomer to Rails. I want to build a simple form that determines
I want build a sketch pad app on iPhone, I assume that this type
I want to build flash application that can detect the user eyes color and
I want to build a python program that deletes all the photos from my
I want to build a basic Client-Server application, where my android smartphone can stream
I want to build a console-like output using JTextPane. Therefore I am using a
I want to build a form that dynamically changes the components visible depending on
I'd like to build a simple form that I can use to create a

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.