similar to: Teaching Models to Render Themselves in the Controller

Displaying 20 results from an estimated 4000 matches similar to: "Teaching Models to Render Themselves in the Controller"

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)
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
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 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
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 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"
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 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,
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 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
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
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
2012 Oct 08
3
Shorewall 4.5.8 IPSEC in a multi-ISP configuration
Hi, I'm using IPSEC in a multi-ISP configuration, lsm 0.131, Kernel 2.6.32, ipsec-tools 0.8.0 This worked fine with Shorewall/Shorewall-Lite 4.5.7. After updating Shorewall to 4.5.8 the routing of ESP packets doesn't work. If I change the Providers.pm file and add connmark => "! --mark 0/$mask" like before in Shorewall 4.5.7 than everything works fine. add_ijump
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
2006 Apr 10
8
Advice on Similar Views with Helpers
I have some embedded tables that form different sections of a view. I find that I use the same look for certain ones which means I have to duplicate the same exact table for each section that''s similar. Is there a way to do.. hmm.. well.. kind of like what a layout does using @content_for_layout, but for a partial. Does that make any sense whatsoever? :) OK so here''s some
2012 Apr 07
27
Shorewall 4.5.2 RC 2
RC 2 is ready for testing. Problems corrected: 1) The 4.5.1 Shorewall Lite and Shorewall6 Lite installers install the wrong SysV init script on Debian and derivatives. That has been corrected. 2) The getparams program now reads the installed shorewallrc file rather than ~/.shorewallrc. 3) The ''load'' and ''reload'' now copy the
2012 Apr 07
27
Shorewall 4.5.2 RC 2
RC 2 is ready for testing. Problems corrected: 1) The 4.5.1 Shorewall Lite and Shorewall6 Lite installers install the wrong SysV init script on Debian and derivatives. That has been corrected. 2) The getparams program now reads the installed shorewallrc file rather than ~/.shorewallrc. 3) The ''load'' and ''reload'' now copy the
2015 Sep 18
2
ExecutionEngine::runFunction and libffi
I noticed that runFunction (for MCJIT) is very limited. At the same time the interpreter already has a fairly generic way of calling functions from a pointer and a Function * (for description) using libffi. Would it make sense to pull that functionality out into a small support library and using it in MCJIT? As is runFunction isn't particularly usable. -- Johannes S. Mueller-Roemer, MSc Wiss.
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
2005 May 03
2
How to put a form for one controller in another controlers view
Hello, If anyone could help me out with this problem I''d appreciate it... I''m making a database of event bookings, I have an events table and a clients table. I''d like to include a form to create a new client in the form for creating a new event. This would update the parent form with the new client_id using AJAX methods (see previous e-mail) so you''d