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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:49:03+00:00 2026-05-31T00:49:03+00:00

I have blog with only one author. Author encapsulates many different fields that will

  • 0

I have blog with only one author. Author encapsulates many different fields that will appear on every page. Do I Need an Author Model?

Where should I store my author (I use MongoDB) and how can I do that in the rails way?

  • 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-31T00:49:05+00:00Added an answer on May 31, 2026 at 12:49 am

    Essentially, you want a model with only one row? The easiest way would probably be to do just that. In your seeds.rb file, just create a new author: Author.create :name => "Dmitry", :rails_skill => 9001 That way, you can always access it with Author.first, and just don’t ever write code to create a new author anywhere.

    That feels kind of odd though. If you’re building this for yourself and don’t care about the ability to add new authors in the future, you could either hardcode the author information everywhere it needs to be printed (gross) or build a custom initializer to set the author information and access it something like Sergio’s answer.

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

Sidebar

Related Questions

A user can have only one blog (the user owns the blog) Blogs can
I have a blog that has a redirect loop, and I can't understand htaccess
I have a blog installed in www.foo.com/wp/ and would like all requests that go
I have a blog (wordpress) and a facebook fan-page for my blog (with more
I have a blog on something.wordpress.com , I simply want one post to ALWAYS
Is it possible to create one model that stands for two different objects? for
I have a blog on Wordpress in which I need to serve contents in
I would like to make a website that is php and only requires one
How can I use two different tables for one entity in Symfony? I have
I have 1 blog say xyz.blogspot.com ,now am uploading my own website,so I want

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.