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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:55:28+00:00 2026-06-04T03:55:28+00:00

EDIT: The first question is my premise itself. Is rails/html SUPPOSED to generate a

  • 0

EDIT: The first question is my premise itself. Is rails/html SUPPOSED to generate a “Create Subject” button without me explicitly asking it to?

So here is the controller that is working with the view

class SubjectsController < ApplicationController

  def index
     list
    render('list')
  end

  def list
    @subjects = Subject.order("subjects.position ASC")
  end

  def show
    @subject = Subject.find(params[:id])
  end

  def new
    @subject = Subject.new(:name => 'default')
  end
  def create
    #instantiate a new object using form params
    @subject = Subject.new(params[:subject])
    #save the subject
    if @subject.save
      #if save succeeds redirect to list action
    else
      #if save fails, redisplay form
      render('new')
    end
  end
end

And here is the misbehaving view (html.erb) file which isn’t generating my button

<%= link_to("<< Back to List", {:action => 'list'}, :class => 'back-link') %>

<div class="subject new">
  <h2>Create Subject</h2>

  <%=  form_for(:subject, :url => {:action => 'create'}) do |f| %>

  <table summary="Subject form fields">
    <tr>
      <th>Name</th>
      <td><%= f.text_field(:name) %></td>
    </tr>
    <tr>
      <th>Position</th>
      <td><%= f.text_field(:position) %></td>
    </tr>
    <tr>
      <th>Visible</th>
      <td><%= f.text_field(:visible) %></td>
    </tr>
  </table>
<% end %>
</div>

Currently, the output on the browser is:

'<< Back to List' (link)

<h2>Create Subject</h2>

Name     [blank-form]
Position [blank-form]
Visible  [blank-form]
[missing button location]

There is supposed to (according to lynda.com) be a button which says “Create Subject” in the missing button location, but it’s not there.

  • 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-04T03:55:29+00:00Added an answer on June 4, 2026 at 3:55 am

    Nothing in your code is supposed to generate a button.

    You’ll need to add:

    <%= f.submit 'Create Subject' %>
    

    inside the form. Maybe between </table> and <% end %>

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

Sidebar

Related Questions

Two questions. First question is I'm trying to create a simple form that when
Hey first question I'm asking here many thanks in advance. I'm using a vector
Edit: Obviously my first question was not really easy to understand, I hope the
My first question here :) I am working with an application written in C++
This is my first question and first day in Linq so bit difficult day
This is my first question on StackOverflow and I've already visited every single question
OK, go easy on me as it's my first question here. ;) I am
What ways can you dynamically create controls in C#? This was objects at first
My first question is, is it possible to specify a generic type as a
Okay, here's my issue (and my first question on SO!), and no, as much

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.