Displaying 20 results from an estimated 20000 matches similar to: "render partial, object.property missing"
2006 Feb 05
6
render partial -- show certain content only if...
i''m working on a _post.rhtml partial, and it displays one blog post.
i''m accessing this partial on the list.rhtml and the show.rhtml
what i''d like is to only show the "link" link on the list.rhtml and not
on the show page.
<%= post.title%>
<br />
<%= post.body%>
<%= link_to
2006 Feb 05
2
accessing the values in a view
trying to build an archive page
in the controller layout file, i render_component(:action => "archive"),
and that works fine. i turned render(:layout => false) within the
"archive" function.
trouble is, and here''s my confusion. as a test, i simply write
def archive
render(:layout => false)
@archives = ''test''
end
2006 Feb 19
8
select, first option empty value?
using the below:
<%= select(''project'', ''project_type_id'', @project_types.collect {|x|
[x.name,x.id]}, {:include_blank => true}) %>
but i''d like that first option to have something like "select project
type" with an empty value?
2006 May 03
0
render partial collection passing property
my view contains a call to a partial:
<%= render(:partial => ''item_list'', :collection => @keyword.synonyms,
:locals => { :action_delete => "removesynonym", and_some_other_stuff
})
%>
_item_list.rhtml contains:
<%= link_to (
image_tag(''/images/deletebutton.png''),
{ :action => action_delete,
:id =>
2006 May 03
2
render partial collection
my view contains a call to a partial:
<%= render(:partial => ''item_list'', :collection => @keyword.synonyms,
:locals => { :action_delete => "removesynonym", and_some_other_stuff
})
%>
_item_list.rhtml contains:
<%= link_to (
image_tag(''/images/deletebutton.png''),
{ :action => action_delete,
:id =>
2006 Apr 30
4
renamed partial won''t render?
hi all
this works
<%= render :partial => "admin/works/work", :collection =>
@artist.works %>
but this doesn''t
<%= render :partial => "admin/works/worklist", :collection =>
@artist.works %>
even though the partial _work.rhtml and _worklist.rhtml are identical.
worklist.rhtml throws
undefined local variable or method
2006 Jan 02
2
Getting Index When Using render :partial
I''m using a web service to retrieve an array of results to a search
and a render :partial to display those results to the user, while at
the same time putting the results into the session. Is there a way
for my _book.rhtml file to have access to the index of the result
currently being displayed, like each_with_index makes available to
its block? This would allow me to have the
2006 Jul 17
3
trouble with render :partial from controller
Hi,
I''m definitely a newbie on rails here. My very first attempt has gone
well up until this point, but for some reason, when I try to do a render
partial, I''m getting a full screen refresh.
I did a render partial just fine from an rhtml file. This problem is
specifically when calling render :partial => "my_partial" from the
controller''s .rb code.
2006 Jun 30
2
Eruby.import -> "uninitialized constant" error
I''m working on porting a dynamic website done in PHP over to mod_ruby. I
have everything set up and working nicely (I can make a .rhtml page, put
ruby code between <% %> and it works etc), but when I try to use
"Eruby.import" as a sort of analog to PHP''s "require_once()", I run into
trouble.
1) eruby is in my cgi-bin
2) here''s a sample of
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 Jun 27
2
Render partials in folders
Right now I have partials in a view folder corresponding with my controller.
ie: controller: example, view: example/_partial.rhtml
and I call it with render :partial => ''partial''
How do I add the partial to another folder and call it?
ie: controller: example, view: example/new_folder/_partial.rhtml
render :partial => ''new_folder/partial'' # does NOT work
2006 Mar 29
3
partial variable help
Can''t work this out:
In list.rhtml:
<% for employee in @employees -%>
<%= render(:partial => "list_form", :object => employee) %>
<% end -%>
In _list_form.rhtml (partial):
<%= employee.id %>
In controller:
@employees = Employee.find(:all)
I get the following error:
undefined local variable or method `employee''
I everything is correct
2006 Apr 01
10
You have a nil object when you didn''t expect it!
Hi,
I am creating a blog to learn ruby on rails.
I have 2 different views/models/controllers, 1 called post and 1 called
comments. How do i link a post from the views/post directory to the
comments that belong to the post in the views/comment directory.
This is the code in the post/show.rhtml
<%= render :partial => "post", :object => @post %>
<%= link_to
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi,
I have an rjs file. I only have one controller called called front. I
have views called "new_title.rhtml" and "_new_title.rhtml"
These work
page.replace_html ''title'', ''new title''
page.replace_html ''title'', :partial => ''new_title''
page.replace_html ''title'',
2006 Jan 16
2
render :file question
Hi,
I have a layout xyz.rhtml. And a footer.rhtml. Both these files reside
in app/views/layouts/.
In that layout, I am making a call like this:
<%= render :file => "footer", :use_full_path => true%>
I have also tried:
<%= render :file => "footer"%>
footer.rhtml is in the same directory as in xyz.rhtml.
I get this exception:
2006 May 02
1
Newbie problem with Ajax and render partial
Hi all,
I''m having this problem that I''m sure will take most of you all but two
seconds to solve, but I''m very much a newbie. I read the documentation,
googled for an answer, to no avail.
I have simple page that lists items, each item as a row in a table. Each
item has a rating and a link to increment/decrement rating. When using
+/- on a rating on the first item,
2006 Mar 30
1
Passing values to a Partial
Hi,
I cannot seem to find out how to pass in a value to a partial. Can
anyone help me?
What I am doing(in the code below) is calling a function in my
controller called setobject. This function just redraws the partial. I
want to be able to change the value @objectname, redraw my partial and
have it be able to use that value. The first the page is drawn it works,
but when i call setobject it
2007 Jun 21
1
render :partial => :url - is it possible?
Hi, this is my first post to the list. I''m still learning the rails
framework, having done most of my previous web development in PHP. I''ve
done a bit of googling for the answer to this question, but maybe I''m
just lacking the right word to search for.
Several parts of my site, such as sidebar components, are
self-contained, modularized and re-used in several parts
2006 May 02
4
passing data from controller to rjs and then to partial
Hello Experts,
I am fetching data in my controller from a web service
def search
response = @@api.DoSearch()
end
and in my .rjs template, I am doing
page.replace_html ''fields_chooser'', :partial => ''fields_chooser''
,:locals =>{:response => response}
page.visual_effect(:Appear, ''fields_chooser'')
and in _fields_chooser.rhtml, I
2006 Mar 27
2
Trouble with rendering partials
This only works when the partial name matches the object name; if I
change "threadtop" to "thread" then it works fine. Is this normal? I
get the following error otherwise:
"undefined local variable or method `thread''"
index.rhtml
---
<% for @thread in @threads %>
<%= render :partial => ''threadtop'', :object => @thread