similar to: Question about template

Displaying 20 results from an estimated 3000 matches similar to: "Question about template"

2006 Jul 27
3
Multiple @content_for_layout in template?
Hi guys, I''m having a few experiments making sites with Rails and I''ve come across a problem. I''ve made a template for the parts of the site that the public will see and it has two main columns in it, a main content column and a thin side column. The content in each of these will change on each page of the site but I''m not exactly sure about how to send
2006 Jul 19
4
Using Application.rhtml as layout for all controllers
I put my nav system in application layout. that way any controller loading will have the nav system. I have one problem though - the <%= yield %> is in the body, so how would my controllers specify other css files? my application layout would look like this: <html> <head> title css include javascript include </head> <body> nav system <%=yield%>
2006 May 23
11
adding layouts within layouts
Hi, I want to be able to have several layouts within each other so that I don''t have to keep repeating the layout code for one, in another. An example would be having a layout for the title of your web page and then having an embedded layout for the body portion in which the HTML for whatever view gets displayed. Is this possible? Thanks. -------------- next part -------------- An
2006 Mar 17
2
How to let the layout be more OO?
I am confused about the @content_for_layout.''cause it will display all the views in the layout.Do I have any methods to let the layout be more OO? I mean that for example,the app currently have more than one views to be displayed,but only some of them to be displayed at the same time at different <div></div> units. I hope there exists a kind of way that: <%= if
2006 Jun 22
4
stylesheet linking and layouts
In my layout, I have something like (shortened for clarity): <html> <head> <%= stylesheet_link_tag "index", :media => "all" %> </head> <body> <div id="site-container"> ... <cut for space> <%= @content_for_layout %> ... <cut for space> </div> </body> A view action has another stylesheet defined
2006 Jul 25
6
DRY question (newbie)
Say i want to include the same chunck of text (a menu on a webpage for example) on each page. Is there a method by which I can save the HTML in a text file and call it up later? Is there a better way? I know ruby has "puts" but i can''t use that b/c it does not work with my webhost (dreamhost.com) Any suggestions? -- Posted via http://www.ruby-forum.com/.
2006 Jul 13
6
Content_for_layout
Question- if I have more then one view I wish to display in a layout , how do I tell content_for_layout what to display and where ? TIA Stuart -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060713/a2d0a8c8/attachment.html
2006 Apr 17
2
nesting layouts?
Hi all, Currently I am working on a site which in principle consists of three div''s, a menu, a left div and a right div. Now the content of the left and right div can vary wildly but the overall ''feeling'' should be the same. Now I have one template, called ''index.rhtml'' which checks in a long list of if-then-else what to render. This is of course
2005 Jun 06
14
Handling Images And Rails
On my website people will be able to upload images of themselves. I was wondering how people are presently handling uploading, resizing and optimizing images in Rails? Do you use a specific piece of software to do it? What would you guys recommend? Any code from RailsDay? :-) Also, do you guys store the images in the DB or just as files? What do you suggest? What are the pros and
2006 Jun 18
4
MongrelDay Documentation -- Memoirs Of A Web Server
Happy RailsDay! While everyone else was out having fun with RailsDay I spent my time wisely and wrote up tons of documentation for Mongrel and cleaned out some of the docs I''ll never write anyway. I also took the time to apply some nice patches from Jonas Pfenniger for easily setting up redirects in Mongrel. Some of the highlighted documents people will be interested in are: *
2006 Dec 17
1
Markaby template & layout (can't get them to work together)
Hi all, I am starting a new rails app with the Markaby plugin (had some issues installing, but think its working). First, i created an index.mab file for a controller containing: h1 "First template" That rendered fine. Also, I do not have a "def index ..." in the controller. Then I created an app/layouts/application.mab file. It didn''t get picked up until after
2006 Apr 12
13
rhtml produces so many white places?????
Hi, I have a rhtml file that uses some ruby code inside, there are not too ruby codes, but it repeats itself thousands of time. I find out each time when the ruby code execute, it will produce the html code correctly. But the produced html will conseved the "format" of the rhtml, and it adds a lot no used white space!!!! example : toto.rhtml <body> <table> <% data.each{
2006 Mar 07
3
Can variables in the template be used in the layout?
This may be a silly question, but I''m wanting to develop a query to pull ''related articles'' based on tags. When a user clicks on an article to read, on that layout, I want a side menu to have the related entries. If I develop the query to do this, can I access the current tags for the entry in the layout? I guess I''m asking, does <% content_for_layout
2005 Jun 27
1
R mailing list archive: alternative interface
For a programming competition (http://railsday.com) I recently entered, I created a web-application to nicely display mail archives. I've loaded up a couple of months worth of r-devel mail and made it available here: http://listomagic.had.co.nz/ The big advantages over the currrent mailman archive are: * messages are threaded, and messages in a thread are displayed together, and some
2010 Jan 31
3
Append/Prepend to a template from controller method
I want a method in app/controllers/application.rb that can prepend/append text to whatever template gets rendered. Of course I can''t call render twice w/o getting a double render error, so is this possible? I want to redirect after a delay using a meta refresh. Here''s what I''ve got: app/controllers/application_controller.rb: def redirect_after_delay (url, delay)
2006 Sep 07
6
Template "specialisation"
I want to use a sitewide default template and use a specific version in some controllers to have a good DRY approach to my layout. Those controllers should add a little bit more HTML before rendering the results of the actions, in order to avoid copying the entire sitelayout every time. How can I do that? Currently my code is like this: class WelcomeController < ApplicationController
2006 Jun 19
9
Railsday 2006
Can you guys post a demo of your application ? Would be great. Thanks, Pratik -- rm -rf / 2>/dev/null - http://null.in
2008 Apr 19
4
Is testing output within content_for possible?
I wanted to test that the links below were being rendered in the views. - content_for :sidebar do %ul.links %li= edit_link edit_admin_contact_url(@contact), "Contact" # view test it "should have the correct side bar links" do do_render response.should have_tag("ul.links") do with_tag("a[href=?]",
2007 May 23
4
content_for
Any ideas how I would go about writing specs for views which make use of content_for? I''d like, for example, to be able to specify that ABC view places XYZ in the sidebar, which I do using content_for(:sidebar). Am I missing something obvious? Kyle
2008 Jan 24
3
Help to spec a rails helper method that uses content_for
Hi guys, I am a Rspec newbie and am having problems creating a spec for a RoR helper method. I have in fact already implemented the helper method and am trying to create retrospective specs. I know its the wrong way to do it but I am still learning Rspec. In my view I have a call to a helper method. <% body_class "users" %> which sets a CSS class declaration in the content_for