Displaying 20 results from an estimated 7000 matches similar to: "Rendering partials based on conditions"
2006 Aug 10
6
Partials - asked before never got reply
I''m trying to figure out how multiple partials in one page would be
configured when they are based on some action in the controller.
As an example -
I have a main/welcome page. If someone new or a user not logged in
arrives at this page I display both a registration form and a login
form. However, if they are logged in then those forms should not show
up on that page. Also should
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 12
4
CSS and Javascript with partials and layouts
Hi,
I''m developing an application that uses a layout called main on every
page. Most of the individual pages are represented with a single partial
template, but there are several pages that are composed of multiple
partials.
My main layout looks something like this:
Code:
<html>
<head>
<title><%= @title %></title>
<%= stylesheet_link_tag
2006 Mar 17
4
using ajax and layouts
Hi.
I copied the layout-example from agile web dev. in rails. When I want
to use ajax to create a search field including
<head><%= javascript_include_tag "prototype" %></head>
does''nt work when I include the line in my
app/views/layout/demo.rhtml. Name of controller is demo_controller.rb.
The search-field is in app/views/demo/observer.rthml and I have to
2005 Dec 01
2
View helpers and nested attributes
Hello all,
I have a model with two entities (document and asset) and a 1:1
relationship defined between them (every model has an asset).
I want to generate a rthml view that generates a hash for document
attributes and a nested hash for asset attributes (for example
{:document =>{:name=>XXX :asset => {date =>XXX}})
According to the Pragmatic Programmers book (page 355), the input
2006 Jul 05
1
form_remote_tag and update
I have a layout which contains multiple divs, (header, menu, content,
footer), content contains <%= @content_for_layout %>.
I have switched all link_to and form_tag to link_to_remote and
form_remote_tag and they are supposed update the content div.
It is working, however instead of updating just the div content, it is
re-rendering the entire layout within the div.
Hopefully someone can
2006 Jan 15
7
Include extra partial in layouts
Hi all,
Does anybody know how to include a partial (next to @content_for_layout) in a
layout file?
I''m looking for a something like @partial_for_include => ''filename'' in my
layout files. So a linked .rhtml file gets picked up from within a layout
file. All my layout files (4 at the moment) have a <div class="navright">
tag, so one change in the
2006 Jan 04
4
HOWTO: Render partial in div
Hey-
I''m using ROR 1.0 and script.aculo.us 1.5.1. I''ve been trying
unsuccessfully to render a partial in a DIV, but can''t seem to get the
right combination of stuff to make it work. There seems to be a few
different ways of going about it. Right now I can render a partial.
What do I need to to render the partial in a div? Here is what it
looks like so far:
#
2006 Aug 07
8
Login form question
I''m using Rails Recipes to create a login form but instead of username
and password, my setup is firstname, lastname, password.
I seemed to be gramatically challenged and not sure how to set up the
parameter list. Can anyone offer up a suggestion.
The book shows the method starting like:
if request.post?
user = User.find(:first, :conditions => [''username = ?'' ,
2006 Apr 28
1
acts_as_taggable help
Ahoy, having a bit of difficulty w/ the acts as taggable GEM.
I was able to create a tagcloud, but now i want to filter items by tags.
in my controller i have
def show_tagged_with
<-- snip snip -->
@items = Item.find_tagged_with( :any => params[:tag_name])
@categories = Category.find_all
@tag_name = params[:tag_name]
@tagged_items = Item.tags_count(:limit
2006 Mar 30
2
A few problems after installation
Hello, I just installed RoR on my server together with cPanel. On port
3000 there is the Rails welcome page. Could you tell me how I can change
the home page directory? Currently, the home page directory is
/home/username/public_html, but I''d like to use RoR''s home directory
instead.
I also have another problem: I put .rthml files and instead of the web
server parsing it,
2014 Apr 15
2
Fwd: ¿Cómo generar informes con R sin utilizar LaTeX?
Victor,
Me parece que podrías investigar si Scribus puede generar e insertar la
salida de R en sus documentos, por lo que estás agregando a tu pregunta me
parece que BI no es el camino. Si lo haces, creo que a más de uno en esta
lista le interesará la experiencia. La alternativa sugerida por Emilio
usando Rthml y CSS con probablemente markdown y, yo agregaría, pandoc me
resulta muy interesante y
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
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 22
3
Rendering partials in ActionMailer?
Hello,
Is anyone out there rendering partials successfully in ActionMailer
templates?
I am having trouble with this, and wasn''t sure if it was my
configuration or something with a version of Rails I''m running.
We''ve got over 15 mailer templates, all working like a charm.
But we have a piece of shared code, that we''d really like to not have to
copy &
2006 Jan 29
1
Rendering partials with ActionMailer
Can ActionMailer render partials (like .sigs, for example)? When I try
to render :partial, I get an error:
undefined method `controller_path'' for SomeNotify:Class
I also tried putting the partial within /shared, but it likes that even
less -- it can''t seem to find the template.
Jake
--
Posted via http://www.ruby-forum.com/.
2006 Feb 15
9
Liquid - form helpers? multiple liquid templates?
Hi,
Its taking me a long time to get my head around the Liquid plugin. I
have a couple of questions which hopefully someone can help me with...
- How difficult would it be to add some kind of Filter or Tag which
would allow other Liquid templates to be included into the current
Liquid template (eg. similar to render(:file => "filename")
- How difficult would it be to add
2006 Jun 22
4
rendering partials in layouts?
Hello all,
Forgive me if this is a really stupid question. How do you render
partials in a layout? It''s probably way easier than i believe it to be.
thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Feb 04
2
rendering subtemplates
hi,
i''ve got main site navigation in the application.rhtml file.
the links in this template correspond to the ''index''
page of various controllers. The controllers themselves
each have navigation of their own, which i would like to
appear in every view for a particular controller in *addition*
to the main site navigation.
The problem I am encountering is that
2006 Jul 24
3
Question about layout
Hey,
I couldn''t find answer for this question for quite long, I hope some
one will explain to me why layout specified in application.rb is not
displayed properly on all views? I mean some divs are displayed wrong
or without layout at all... let''s say login.rhtml has layout on its own
and now it works ( exactly this same as project.rhtml which is layout
for the whole