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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:40:10+00:00 2026-06-15T04:40:10+00:00

I’m having a slight issue with a controller action. The behavior i’m after is

  • 0

I’m having a slight issue with a controller action. The behavior i’m after is the option to edit a note. I want the user to be able to edit the note, just like they created the note, in a modal(twitter bootstrap). Creating a note this way works fine. The problem is coming to edit the note. The main issue is that I need to always know the exact note id when a user clicks on a “edit” button. To complicate things a bit more, there is a “dashboard” controller/model which acts as a container for “notes” and other things.

Here is the code/link I have in the view on the dashboard which displays all the users current notes.

        = link_to "Edit Note", "update_note/#{n.id}",{:note_id => "#{n.id}"}

So Here I am sending some params contain the note id. Then in the controller action, in the dashboard (the container)

          def update_note
            @user         = current_user
            @edit_note_id = params[:params1]
            redirect_to dashboard_path and return
            respond_to do |format|
               format.html { render "#modal_edit_notes"}
            end
          end

So at point I have the unique note id, and instantiating something so when hopefully the modal loads up I can create a form based on that. The issue that I’m having is getting the controller at this point to go back to the dashboard, and pop up the modal, now that I have the note.id.

To trigger the modal, I normally would do a

          href = #modal_edit_notes, data-toggle = "modal"

Thanks!

  • 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-15T04:40:10+00:00Added an answer on June 15, 2026 at 4:40 am

    OK, you have two options here.

    1. Embed a form inside a hidden element for every single note you display, and then just have that pre-rendered form show up in the modal when you want to edit that particular note.

    2. Load the content of the modal via ajax, this will require a little bit of custom JS to make it work with the bootstrap modals, but isn’t too difficult. This is how I would do it.

    Also, as a side point, the update_note method really should be a update method in a NotesController.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I want to show the soap response to UIWebview.. my soap response is, <p><img

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.