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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:30:53+00:00 2026-06-18T21:30:53+00:00

I have been learning from and using elements of Hartl’s Rails tutorial for my

  • 0

I have been learning from and using elements of Hartl’s Rails tutorial for my own app and learning experience. In the tutorial, in order to follow a user, the default option has been clicking through a Bootstrap-Sass button alongside Rails’ form_for helper as seen below:

<%= form_for(current_user.relationships.build(followed_id: @user.id)) do |f| %>
  <div><%= f.hidden_field :followed_id %></div>
  <%= f.submit "Follow", class: "btn btn-large btn-primary" %>
<% end %>

However, I’d like to modify the input as a custom button, and changing the class from btn btn-large btn-primary to .follow-button.

My CSS for follow-button as follows. As noted in the comments, I have having trouble modifying basic elements like the transparency and font size and color (the font seem to default to the basic Bootstrap font), while other elements, such as the hover aspect does function. How do I override some of the default Bootstrap settings for forms so that all my custom elements come out? Thanks!

.follow-button{
     background: transparent;
     border: 1px solid #e8e8e8;
     display: block;
     float: right;
      &:hover { 
      background: #0089d1;
    }
      a {
      color: #006faa;
      font-weight: 400;
      font-size: 1.4em; //font size does not change
      display: block;
      padding: 0px 4px 0px 4px; //modification doesn't show..
      text-decoration: none;
      &:hover { 
      color: rgb(229, 246, 255);
      }
    }
  }

Edits:

With the updated CSS code:

.follow-button{
     background: transparent;
     border: 1px solid #e8e8e8;
     display: block;
     float: right;
      &:hover { 
      background: #0089d1;
    }
    input[type='submit'] {
      color: #006faa;
      font-weight: 400;
      font-size: 1.4em; //font size does not change
      display: block;
      padding: 0px 4px 0px 4px; //modification doesn't show..
      text-decoration: none;
      &:hover { 
      color: rgb(229, 246, 255);
      }
    }
  }

The Rails submit form:

<%= form_for(current_user.relationships.build(followed_id: @course.id)) do |f| %>
  <div><%= f.hidden_field :followed_id %></div>
  <%= f.submit "Follow", class: "follow-button" %>
<% end %>
  • 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-18T21:30:54+00:00Added an answer on June 18, 2026 at 9:30 pm

    You are styling a .follow-button that contains a link (a). but f.submit creates a input type of submit. Since there is now “a”, it would never match your style selectors.

    <%= f.submit "Follow", class: "follow-button" %>
    

    and then

    .follow-button{
         background: transparent;
         border: 1px solid #e8e8e8;
         display: block;
         float: right;
          background: #0089d1;
          color: #006faa;
          font-weight: 400;
          font-size: 1.4em; //font size does not change
          display: block;
          padding: 0px 4px 0px 4px; //modification doesn't show..
          text-decoration: none;
          &:hover { 
            color: rgb(229, 246, 255);
            background: #0089d1;
          }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just learning NHibernate. I have been using examples from the documentation and
I am learning rails by following the Rails Tutorial under Ubuntu. I have been
I have been reading from the book The C Programming Language learning C, and
I have been learning windows API from online and PDF books but I hear
I have been learning RESTful webservices following this tutorial http://www.vogella.de/articles/REST/article.html . As I understand,
I'm currently learning PHP and MySQL and I have been working from a basic
I am learning Javascript, I have been using PHP for about 10 years so
Im using OpenGL for an app that im trying to make. I've been learning
So I've recently started learning Scala and have been using graphs as sort of
I have recently been learning MVC3 using Entity Framework 4.3 and Dependancy Injection so

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.