Well, I figured now, that there is really no need to tell the controller to use the layout, it makes it by default, BUT...I'm still unable to set up the wallpaper. I moved the picture to the directory public/pic/ and add the address pic/darkKnight_wide.jpg to the layout file. But it only affected the index view file, in others there is still the same link for the background, but the background isn't shown.
Well, I figured this one out now also...apparently there is huge difference between those two strings: /pic/picture.jpg pic/picture.jpg Which I guess means there are no relatives paths in rails, right? Jan 2010/7/24 Jan Kadera <[email protected]> > In the tutorial here: > http://guides.rubyonrails.org/layouts_and_rendering.html > a have found a problem. > There is stated: "By default, the file is rendered without using the > current layout. If you want Rails to put the file into the current layout, > you need to add the :layout => true option." > ....but where? I tried the view file and the controller file and neither > doesn't work. > > Jan > > > > 2010/7/24 Jan Kadera <[email protected]> > > Thanks a lot :) >> Jan >> >> >> 2010/7/24 Hassan Schroeder <[email protected]> >> >> On Fri, Jul 23, 2010 at 5:22 PM, Jan Kadera <[email protected]> >>> wrote: >>> > Well, after a while trying I found a way to do it right. The first >>> time, I >>> > created just controller >>> > >>> > and it didn't work (that's the point where you were suggesting routing) >>> > >>> > but the only thing I needed was to destroy all the work done and use >>> the >>> > command >>> > script/generate controller home action1 action2... >>> > >>> > and voi'la myIP:3000/home works now :) >>> >>> 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, >>> -- >>> Hassan Schroeder ------------------------ [email protected] >>> twitter: @hassan >>> >>> -- >>> 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 [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<rubyonrails-talk%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >>> >> > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

