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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:04:12+00:00 2026-06-16T01:04:12+00:00

I am trying to create a single page CRUD. Right now, I faced some

  • 0

I am trying to create a single page CRUD.
Right now, I faced some errors with the show function.

An example of the application can be found here:
http://tryoutcreation.herokuapp.com/

It appears to work alright.
After creation, the show function works fine if the page is not refreshed.

However, if it is refreshed, the dialog stops working as a dialog and just shows as a div.

You can try it by creating a user and clicking the show function. Then try refreshing the page, the same div will just be shown on the page instead of as a dialog.

The source can be found here:
https://github.com/frozzie/ModalCrud

Related codes:

The dialog is the show-form.

  <tr id = "<%= dom_id user%>">
<td><%= user.user_name %></td>
<td><%= user.email %></td>
<td><%= user.password %></td>
<td><%= user.account_type %></td>
<td><%= link_to 'Show', user, :remote=>true%></td>
<td><%= link_to 'Edit', edit_user_path(user), :remote => true %></td>
<td><%= link_to 'Destroy', user, :remote => true, method: :delete, data: { confirm: 'Are you sure?' } %>
</td> 
<div id = "show-form" title="User Information">
  <p>
  <b>User name:</b>
    <%= user.user_name %>
  </p>

  <p>
    <b>Email:</b>
    <%= user.email %>
  </p>

  <p>
  <b>Password:</b>
    <%= user.password %>
  </p>

  <p>
    <b>Account type:</b>
    <%= user.account_type %>
 </p>
</div>
</tr>

It should only be opened when the show button is clicked.
$(“#show-form”).dialog( “open” );

This is the dialog.

   $( "#show-form" ).dialog({
        autoOpen: false,
        height: 400,
        width: 350,
        modal: true,
        closeOnEscape: true,
        resizable:false,
        buttons: {
            Cancel: function() {
                $( this ).dialog( "close" );
            }
        }
    })

Any ideas on why it happened would be appreciated.

  • 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-16T01:04:12+00:00Added an answer on June 16, 2026 at 1:04 am

    This has less to do with your js than it does your php.

    Remove this from your code:

          <div id = "show-form" title="User Information">
            <p>
            <b>User name:</b>
            <%= user.user_name %>
            </p>
    
            <p>
            <b>Email:</b>
            <%= user.email %>
            </p>
    
            <p>
            <b>Password:</b>
            <%= user.password %>
            </p>
    
            <p>
            <b>Account type:</b>
            <%= user.account_type %>
            </p>
            </div>
    

    then look to output the users information correctly. Don’t just output this at the top of the page.

            <tr id = "<%= dom_id user%>">
                <td><%= user.user_name %></td>
                <td><%= user.email %></td>
                <td><%= user.password %></td>
                <td><%= user.account_type %></td>
                <td class="click_me" data-id="<%= dom_id user%>"><%= link_to 'Show', user, :remote=>true%></td>
                <td><%= link_to 'Edit', edit_user_path(user), :remote => true %></td>
                <td><%= link_to 'Destroy', user, :remote => true, method: :delete, data: { confirm: 'Are you sure?' } %>
                </td> 
            </tr>
            <tr  style="display: none;" class="hidden_<%= dom_id user%>">
            <td colspan="8">
    
            <div class = "show-form" title="User Information">
            <p>
            <b>User name:</b>
            <%= user.user_name %>
            </p>
    
            <p>
            <b>Email:</b>
            <%= user.email %>
            </p>
    
            <p>
            <b>Password:</b>
            <%= user.password %>
            </p>
    
            <p>
            <b>Account type:</b>
            <%= user.account_type %>
            </p>
            </div>
    </td>
    </tr>
    

    JS

    now,

    $('td').on('click','.click_me', function(){
          var id = $(this).data('id');
          $('.hidden_'+id).slideToggle();
    });
    

    This isn’t perfect… lol by any means, but at least you can work with it hopefully.

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

Sidebar

Related Questions

I am trying to create a single page webapp. There are two divs, right
I am trying to create single page website. check my example Here, while click
I am trying to create a python script that opens a single page at
I'm trying to create a single page form to create a 'work item'. One
I am trying to create a single web page that will display easily on
I'm trying to create a single, one-off page that will combine information from several
I am trying to recreate the ASP.NET Single Page application as demonstrated by Steven
I am trying to create a single php file I can use to display
I have followed a microsoft video trying to make the single page application and
I am trying to create a table with a single column using the following

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.