--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Isn't there any more peaceful way to do it without declaring war to half of
> the application by changing routing?
What *are* you talking about?
You use routing to match URLs to the content you want to serve.
If you're not getting the results you expect, run `rake routes` to see
what's actually configured.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
--
because the routes.rb file has been updated, which you could have
easily done manually :-)
> BUT! What I'm trying to figure out now is addressing inside of the app. I'm
> trying to set up a background for the page but the relative path starting
> from the route of the app doesn't work and unfortunately the absolute path
> doesn't work either.
> So where is the root of the relative path?
Static resources are typically served from /public/* so e.g. an image in
{RAILS_ROOT}/public/images/foo.png would be accessed by the URL
http://hostname:port/images/foo.png
HTH,
--
> On the other hand the absolute path is recognized by starting with the only
> root of the whole computer filesystem, like "/" or "C:\"
No, "absolute path" in terms of a web app means a path starting with
a "/" that indicates the base of your *web application's root*. It's usually
better to use absolute paths, since the actual context of any given page
or page fragment may not be obvious.
> Sir, I may be an idiot, but it doesn't work.
> I have pictures in public/pic
> the picture filename is darkKnight_wide.jpg
> and I'm reffering to it like this:
> <body background=<%= image_tag "darkKnight_wide.jpg" %>>
Of course it doesn't work -- you ignored what you were told, which
was to put it in /public/images, which is the path an image_tag will
create for it. It's a convention. Rails has lots of them, and learning
and adhering to them will make this all much easier :-)
> and I know nothing abou html, but there is no way that the 'higher power'
> translating that ruby babbling
And if you think this whole thing is "ruby babbling" -- why are you even
bothering?
> 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 :-)
--
On Sat, Jul 24, 2010 at 9:57 AM, Jan Kadera <honza....@gmail.com> wrote:
--
> 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)
I have absolutely no idea what you mean by that, but good luck :-)
> <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 :(
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 :-)
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,
which is just weird :(
Jan.
--
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 :(
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"); }
On Sat, Jul 24, 2010 at 10:18 AM, Jan Kadera <honza....@gmail.com> wrote:
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.
I tried heroku. I wasn't even able to figure out how to connect to it or do anything with it :(
> So, can I ask how to join the image_tag tag with the information of align of
> image?
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,
--