Are those classes built-in?

At: Getting Started with Rails — Ruby on Rails Guides

You can see the following for example in /app/views/posts/show.html.erb

.
.

<%= f.label :body %>
<%= f.text_area :body %>
<%= f.submit %>
. .

Regarding:

Are those classes built in Rails? Such that we don’t have to define them
like we do when building an HTML/CSS website?

Thanks.

Abder-Rahman A. wrote:

At: Getting Started with Rails — Ruby on Rails Guides

You can see the following for example in /app/views/posts/show.html.erb

.
.

<%= f.label :body %>
<%= f.text_area :body %>
<%= f.submit %>
. .

Regarding:

Are those classes built in Rails? Such that we don’t have to define them
like we do when building an HTML/CSS website?

Instead of asking, take a look through whatever CSS is getting included.
That will answer your question.

Thanks.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Thanks.

I have created a “main.css”, and referred to it in
“application.html.erb” as follows:

<%= stylesheet_link_tag “main” %>

But, in my “main.css” there is NO “field” class.

don’t you think it is built in Rails itself?

On 22 August 2010 15:24, Abder-Rahman A. [email protected] wrote:

I have created a “main.css”, and referred to it in
“application.html.erb” as follows:

<%= stylesheet_link_tag “main” %>

But, in my “main.css” there is NO “field” class.

don’t you think it is built in Rails itself?

Have a look in scaffold.css which was made by the scaffold generator.

Colin

Hey, a question I can answer! :slight_smile:

Those aren’t ruby classes as you’re probably thinking about. They’re css
classes and (from my limited knowledge of css) basically control the
presentation of the text in between the tags.

I’d look in the css file for “field” to see how it’s being presented
(font, color, size, etc)

Abder-Rahman A. wrote:

At: Getting Started with Rails — Ruby on Rails Guides

You can see the following for example in /app/views/posts/show.html.erb

.
.

<%= f.label :body %>
<%= f.text_area :body %>
<%= f.submit %>
. .

Regarding:

Are those classes built in Rails? Such that we don’t have to define them
like we do when building an HTML/CSS website?

Thanks.

On 22 August 2010 22:07, Abder-Rahman A. [email protected] wrote:

Have a look in scaffold.css which was made by the scaffold generator.

Colin

Thanks Colin.

In public/stylesheets I have created a custom .css “main.css”.

There is no such classes there.

Do you mean that class field is not defined in scaffold.css? I am not
using Rails 3 so I cannot confirm this but I would be surprised if it
is not there. If not then just put whatever style you want for that
class in your own stylesheet.

Colin

I’m using Rails 3. And, as mentiond I don’t have “scaffold.css”, and
have “main.css”.

Colin L. wrote:

On 22 August 2010 15:24, Abder-Rahman A. [email protected] wrote:

I have created a “main.css”, and referred to it in
“application.html.erb” as follows:

<%= stylesheet_link_tag “main” %>

But, in my “main.css” there is NO “field” class.

don’t you think it is built in Rails itself?

Have a look in scaffold.css which was made by the scaffold generator.

Colin

Thanks Colin.

In public/stylesheets I have created a custom .css “main.css”.

There is no such classes there.

What do you think?

On 22 August 2010 22:26, Abder-Rahman A. [email protected] wrote:

I’m using Rails 3. And, as mentiond I don’t have “scaffold.css”, and
have “main.css”.

In your original post you said you are working from
Getting Started with Rails — Ruby on Rails Guides. In section 6
it says that the scaffold generator will build 15 files, including
scaffold.css. Did it not build that file for you when you ran the
scaffold?

Colin

On 23 August 2010 09:07, Abder-Rahman A. [email protected] wrote:

scaffold?

Colin

It actually did build “scaffold.css”.

The case is I have created another application and entered a custom
“main.css” and wondered how the classes still work while the stylesheet
that contains its classes is not there.

It would have saved a lot of time if you had said that in the first
place. :slight_smile:

What do you mean by ‘the classes still work’? There is no need for a
class to have a css entry, the data will still be displayed, using
whatever is the current style at that point in the page.

Colin

Got you, thanks.

Colin L. wrote:

On 22 August 2010 22:26, Abder-Rahman A. [email protected] wrote:

I’m using Rails 3. And, as mentiond I don’t have “scaffold.css”, and
have “main.css”.

In your original post you said you are working from
Getting Started with Rails — Ruby on Rails Guides. In section 6
it says that the scaffold generator will build 15 files, including
scaffold.css. Did it not build that file for you when you ran the
scaffold?

Colin

It actually did build “scaffold.css”.

The case is I have created another application and entered a custom
“main.css” and wondered how the classes still work while the stylesheet
that contains its classes is not there.

Also, I think I may have had to enter the question regarding the
customized css in another thread.

Thanks.