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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:00:24+00:00 2026-06-04T18:00:24+00:00

I created a new page with Active Admin. It currently just shows a table

  • 0

I created a new page with Active Admin.
It currently just shows a table which lists all entries of the model “HotelRoom” for the current date.

Now I want to add a form where I can choose the Date for the data displayed in the table.
But I can’t get my head around how to add the form.

Forms usually look like this:

<% form_for @hotel_rooms do |f| %>
  <p>
    <%= f.label :date %><br />
    <%= f.text_field :date %>
  </p>
  <p><%= f.submit "Submit" %></p>
<% end %>

and then I want to add a datepicker to the textfield like described here http://railscasts.com/episodes/213-calendars
But I always get the error:

undefined method `model_name' for NilClass:Class

What am I doing wrong?

EDIT: I tried adding the variable to the controller like this in the custom page file

 controller do
  def index
    @hotel_rooms = HotelRoom.all
  end
 end

but still no luck. Same error.

  • 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-04T18:00:25+00:00Added an answer on June 4, 2026 at 6:00 pm

    As usual – you have your @hotel_rooms variable not set in Controller at all ( or item with provided conditions was not found in DB ).

    Update:

    Otherwise – try to use:

    form_for :hotel_room ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a new popup window from an existing page using: window.open(myUrl,myName,width=200,height=200); Now on
I created a new content type for a wiki page library. I added this
I created a new ASP.NET MVC application. The home page looks like this: I
I have created a new Facebook app. Whenever I visit the canvas page (https://apps.fac...)
Ive created a new page in the public/ folder called hello.html (for example). But
I have a PhotoSwipe gallery on my page which is created programatically like this:
I just added active admin to my rails app and I'm unable to create
I create a new page using HTMl and I whant when user clicks on
I have a Create new account page. The form is in page named Register.php
is there any way to create a new page at runtime? Maybe generate the

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.