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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:15:32+00:00 2026-05-27T03:15:32+00:00

so i’m creating a simple RoR app with an evernote look and feel. notebook.rb

  • 0

so i’m creating a simple RoR app with an evernote look and feel.

notebook.rb

class Notebook < ActiveRecord::Base
  belongs_to :user
  has_many :notes
end

note.rb

class Note < ActiveRecord::Base
  belongs_to :user
  belongs_to :notebook
end

And i went ahead and created a static controller with an index view, this will be where I display the dashboard

static_controller.rb

class StaticController < ApplicationController
  def index
    if user_signed_in?
      @user = current_User
      @notebooks = @user.notebooks
      @notes = @user.notes
    end
  end
end

How should I display the list of notebooks? and whenever the user clicks a specific notebook, that notebook’s notes gets displayed in the second column…

I’m thinking of creating iframes for this, but it would be better if these were all divs and we can just use jquery to update them dynamically… but I still haven’t figured out how to do it.

Sorry to sound very newbie-ish.

Here’s a snapshot of what I basically want to accomplish

https://i.stack.imgur.com/8gs0l.png

Thank you for your time!

  • 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-27T03:15:33+00:00Added an answer on May 27, 2026 at 3:15 am

    hashify notes to group it by notebook_id

    @notes_hash = @user.notes.group_by(&:notebook_id)

    then on you notebook list, when the notebook link is clicked, catch the notebook_id and just look into your @notes_hash

    notes = @notes_hash[notebook.id] || [ ]

    you can use jQuery to dynamically update your second column.

    <script type="text/javascript">
      var notes = <%= notes.collect{|a| a.note_content }.to_json %>;
    
      /* 
       * do stuff here with your array of notes content
       *
       */
    
    </script>
    

    make sure you require ‘json’ gem to use .to_json method.

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

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload

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.