search for: render_partials

Displaying 20 results from an estimated 80 matches for "render_partials".

Did you mean: render_partial
2005 Apr 13
2
render_partial & RXML
Does render_partial work within a RXML file? I am attempting the following: xml.users do for user in @users render_partial ''user'', user end end All that is output is: <user> </user> Without any exception or anything to indicate that I''m doing something wrong. Does anyone have any experiece with this? Josh
2005 Jun 29
2
Complex helper with block help
Hi everyone, I am writing a helper function that takes a parameter and block and wraps some HTML around it. e.g. def box_with_caption(caption, &block) data = capture(&block) buffer = render_partial("helpers/box_caption", :caption => caption) buffer << render_partial("helpers/box_data", :data => data) buffer end however, when I attempt the following,
2007 Nov 03
1
Specs for Helpers that call render
The helper spec I am writing tests a helper method that calls render. ## module HelperHelper def render_partial render :partial => ''partial'' end end ## The helper spec. ## describe HelperHelper do it "should render partial" do render_partial.should_not == nil end end ## The output generated ## $ spec spec/helpers/home_helper_spec.rb .F 1)
2006 Jul 26
1
ajax render_partial
Hi, i was hoping someone could reffer me to a doc or an explination (i haven''t found anything) for rendering a partial via an ajax request - - i know i could probably do it via link_to :action => x and then def x render_partial ''y'' end but i was hoping ther was something simpler, and more rails-like caller such as render_ajaxed_partial
2007 Jul 19
7
NoMethodError in partial driving me mad
Hello, i simplified have a news model, a news category model and a news controller. my _news.rhtml partial renders a single news entry. in my controller there are the actions show and show_category. if the "show" action is called, a single news item is rendered through my partial with no errors. if the "show_category" action is called, i get a NoMethodError while displaying
2005 Apr 06
6
Mimic something like layout on a smaller scale?
I need to add various header and footer dressings around groups of form fields for GUI goodness, and am wondering if there''s already something out there that will suit my needs. These headers/footers have special properties for display(title, help links, etc...). I want to be able to easily take advantage of the existing HTML helper methods provided for controllers, in a mini-layout type
2006 Aug 01
2
Partial Naming Madness
Hi, I am having the following issue with a partial. During initial page load, I am doing a "render_partial_collect ''foo'', @foos", and all goes well. Each foo partial makes use of a variable inside called ''foo'' (and can get foo.id etc). After all the partials are loaded, I need to :update a div corresponding to one of the partials (ie re-load the
2006 Feb 14
22
Teaching Models to Render Themselves in the Controller
I am trying to teach my models how to render themselves, i.e. <%= my_model_object.render() %> Let me explain my reasoning and proposed method before this gets shot down as anti-MVC. Let''s say I am writing a contact-management application. I have a class Contact. I will need to display this class all over the application. My first choice is to use a partial. Now I can
2006 Jul 16
3
RJS problem
I have an odd problem while trying to use a simple rjs. _test.rjs : page.alert "test" test.rhtml: <script><%=render_partial(''test'')%></script> When I am attempting to view controller/test the page comes as if it was a text file. So i am actually seeing: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2006 Jun 26
0
Using a partial multiple times in a view
Hi, im trying to execute multiple cmds in a method that use the same view which has multiple calls to the same partial inside it. However i cant get it to work correctly, so any help here would be appreciated heres the controller code def index cmd_df = "df -Ph" exec_cmd(cmd_df) cmd_sys = "uname -a" exec_cmd(cmd_sys) end private def exec_cmd(cmd)
2007 May 05
0
integration with movtable
Hi, I''m trying to integrate movtable to display some data. The file that lists out the partials to display the data looks like this: <html> <head> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <title>Movtable - List</title> <%= stylesheet_link_tag
2006 Jun 08
1
No rhtml, rxml, or delegate template found
hi , i''m having a problem with rendering a partial , the partial is in the apps/view/polls folder with the name : _antwoorden_user.rhtml in the view i''m rendering it with <% if @user %> <%= render :partial => ''polls/antwoorden_user'', :locals => {:poll => @poll, :user => @user} %> <% else %> .... gives me the error => No
2005 Aug 19
3
accessing DB result in template
hello, I have the following in my controller def totalmembers @total = User.find_by_sql "SELECT COUNT(*) as count FROM users " end now inside my template how do i access the field "count" from the query so i can print out the number of members ? I tried everythign like <%= @total.count %> but nothing works. thanks adam
2006 Dec 13
4
RSpec and simply_helpful
Hi All I''m having some problems running my view specs when using simply_helpful. I have it semi-working via the following: module SimplyHelpfulHelper def self.included(base) base.send :include, SimplyHelpful::RecordIdentificationHelper base.send :include, SimplyHelpful::RecordTagHelper end end context "The index template" do setup do @shift =
2008 Mar 23
6
Locals do not appear in partial unless collection is explici
Maybe I''m misunderstanding something but it appears as if <%= render :partial => @items, @locals => { :this => ''that'' } %> does not give the local variable this but this one does: <%= render :partial => ''items/item'', :collection => @items, @locals => { :this => ''that'' } %> Shouldn''t they mean
2005 Nov 17
7
render :partial in mail template
Hi, Is it possible to render a partial template from within a mail template? I get the following error undefined method `controller_path'' for SupportMailer:Class Extracted source (around line #8): 5: 6: <%= @url %> 7: 8: <%= render_partial ''sig_admin'' %> Jeroen
2006 Mar 05
1
Help with Self-Referential HABTM
With the help of the Rails Recipes have got a self-referential HABTM relationship working, but I''m really struggling with getting a new entry from a form accepted. i should say here that the form is also submitting info for the join table too. So in my model I have: class Type < ActiveRecord::Base has_and_belongs_to_many :subtypes, :class_name => ''Type'',
2007 Dec 07
4
strange error on mock proxy
I''m banging my head over this really strange error in a view test when I run "rake spec". The weird thing is that I don''t get the error when I run the spec file by itself. Here is the spec (I know, fixtures are the devil): describe "/units/new.html.erb here" do fixtures :units, :accounts, :groups it_should_behave_like
2006 Mar 01
2
Method Calling Problems
Hi all! I am attemping to call a method inside of my LeviUserController named show_userland from my LeviInterfaceController class. No matter how I do it, I keep getting some type of error. If I make the method a class method, then my render_partial inside of show_userland can''t be found. If i call it using @luser = LeviUserController.new; @luser.show_userland; I get an error with a nil
2008 May 03
4
silly partial qu
hi all, i''m just trying to check a partial has been rendered, by using: response.template.should_receive(:render).with(:partial => "tasks/list") this passes, even if I put something bogus in the partial name, such as: response.template.should_receive(:render).with(:partial => "___tassdfsdfks/list") does anyone know why this doesn''t fail? is this the