Deep beginning

It unfortunately doesn't work for background, or I don't know how to throw
it.

What exactly does that mean? How are you trying to set "background"?

And one little question...how do I align pictures inserted into web like
this? I can't google it.

You need to study basic HTML and CSS if you're going to be doing
web apps, I'm afraid. And I'm sure you can easily google up some
tutorials on those subjects :slight_smile:

Frederick:
Thank you, it’s much clearer. Unfortunately, since I work with files saved in app/… and the address equals public/… I cannot imagine any case to use relative path :confused:

Hassan.:
I figured it out, but from the example I really wasn’t able to derive that I have to do it that and only that way exactly.
And I’m bothering for many reasons…you would probably consider the most interesting one that I don’t want to use web spaces with advertisment (That of course I find one useful ruby webhosting)

Fred:
Thank you, I’ll take a look.

Hasan:
As I described earlier: <body background=<%= image_tag “darkKnight_wide.jpg” %>>
but since my mistake I moved pictures to the images dir…but this still doesn’t work :frowning:
And abou studiing html and css…I did, but I do not understand to articles about this stuff, so I learn stuff I need to do and I’m learning it backwards, it works for me.

Jan

I have absolutely no idea what you mean by that, but good luck :slight_smile:

<body background=<%= image_tag "darkKnight_wide.jpg" %>>

The background attribute is deprecated -- you should really use CSS
for this.

but since my mistake I moved pictures to the images dir...but this still
doesn't work :frowning:

Did you restart your server? What's `view source` show you as the
path? Are you using a tool like Firebug to examine why the request
isn't working?

And abou studiing html and css...I did, but I do not understand to articles
about this stuff, so I learn stuff I need to do and I'm learning it
backwards, it works for me.

If you say so :slight_smile:

You might want to play around with some static HTML pages a bit to
get a better feel for how HTML and CSS work...

FWIW,

I meant I was unable to find ruby webhosting, where could I try to build up web pages in ruby. Even If I found it, it would contain advertisment for being free. So this way I can build my own web on my own computer with ruby and without advertisment.

btw. the background ruby code generates this

<body background= Darkknight_wide >
which is just weird :(

Jan.

try http://www.heroku.com

I meant I was unable to find ruby webhosting, where could I try to build up
web pages in ruby. Even If I found it, it would contain advertisment for
being free.

heroku.com has a minimal free plan that doesn't involve advertising,
and it's very easy to work with.

btw. the background ruby code generates this
<body background= <img alt="Darkknight_wide"
src="/images/darkKnight_wide.jpg?1229174053" /> >

which is just weird :frowning:

No, it's just wrong. `image_tag` creates a tag for an image, which is
not what the background attribute is expecting.

You should use your style sheet to set this, e.g.

body { background-image: url("/images/darkKnight_wide.jpg"); }

I added to .css file this
background: /images/darkKnight_wide.jpg
aaand it doesn’t work.
My problem with css is that it is not part of the source code, so I cant take a look, where in the code is it built in. You may say that it is obvious, but I’m saying I don’t trust obvious, I trust my eyes. I’m sorry on this one, but I really don’t believe that .css is worthed, but if you’ll be so kind and advice me, how background in css works, I’ll be really glad.

“Did you restart your server? What’s view source show you as the
path? Are you using a tool like Firebug to examine why the request
isn’t working?”
Restart I did indeed.
What is view source and Firebug I don’t know
…and I don’t want to create new google. I just want it to be simple and work, please.

"You might want to play around with some static HTML pages a bit to

get a better feel for how HTML and CSS work…"
I’d say thats exactly what I’m doing last few days despite what I wanted to do…


I tried heroku. I wasn’t even able to figure out how to connect to it or do anything with it :frowning:
but thanks for advice with the background.

Jan

I added to .css file this
background: /images/darkKnight_wide.jpg
aaand it doesn't work.

Of course it doesn't work -- it's not what I showed you.

My problem with css is that it is not part of the source code, so I cant
take a look, where in the code is it built in. You may say that it is
obvious, but I'm saying I don't trust obvious, I trust my eyes. I'm sorry on
this one, but I really don't believe that .css is worthed, but if you'll be
so kind and advice me, how background in css works, I'll be really glad.

What are you talking about? CSS is certainly part of your source code.

What is `view source` and Firebug I don't know

Every browser offers the option to view the HTML source of a page
you're looking at it. It's a basic tool for troubleshooting (and learning).

Firebug is a Firefox extension that gives you visibility into a number
of areas (CSS, network connections, etc.) and is indispensable for,
again, troubleshooting and learning.

...and I don't want to create new google. I just want it to be simple and
work, please.

It is simple. You need to develop a better understanding.

Good luck.

File system paths are irrelevant, what matters are the URLs browsers
use to access stuff - even if the file you're working on is app/
controllers/posts.rb, that's just /posts to the web browser.

Fred

It works now,thanks.
So, can I ask how to join the image_tag tag with the information of align of image?

Jan

Go to <http://api.rubyonrails.org/> and look at the entry for image_tag

And you might want to bookmark the following 2 urls, as well:

<http://www.w3.org/TR/html401/>
<http://www.w3.org/TR/CSS21/>

HTH,

You will save yourself a lot of time and frustration if you first
learn the basics of HTML and CSS before trying to build dynamic
websites. You have to learn to walk before you can run.

Guys, I really appreciate your help, but I can’t read those manuals, because they are wrong. Those are written for people like you, who already understands, which is imho needles.

For example on that api page, you recommended me for seek out the align tag…it is not there. Well, since I’m not a complete idiot and I knew it should be there, I tried the tag align in the format of examples there and it worked.

But I can’t learn like that. I’m no oracle and don’t know what the author meant…ussually.

And I’m afraid that stuff like: You don’t use , you use .css…I think it wont be written anywhere, because in the manual to html will be information, that it is done like the first example and in .css manual will be written that it can be done like the second. Am I wrong?

Jan