Displaying 9 results from an estimated 9 matches for "partial_path".
2011 Apr 06
1
Time to fix PartialRenderer#partial_path
For the longest time PartialRenderer#partial_path has prefixed the
prefix of the current controller when it is nested in a module. This
hasn''t been a problem (because nesting controllers wasn''t that common)
but with 3.1 striving for better engine support, this problem is now
larger because all of your controllers for an engine wi...
2010 Feb 12
2
How to source files from a search path?
Suppose some environment variable (say MY_R_INC) has a number of
paths. I want to source some file relative to some path in $MY_R_INC
(just as #include in C++ does, which looks for header file in a number
of directories). I RSiteSearch'ed, but I don't find any function that
satisfies my need. Could somebody let me know if I overlooked
something?
2006 Dec 13
4
RSpec and simply_helpful
...My template just makes a call like this:
<%= render :partial => @shifts %>
I''ve done some experimentation, and it seems that RSpec''s
implementation of ''render_partial'' is rewriting the partial path
trying to be smart about it but breaking things. The partial_path,
once it reaches render_partial_with_record_identification, ends up
being "/shifts//#<Spec::Mocks::Mock:0x28450cc>". This is caused by
the method being overwritten in
rspec_on_rails/lib/extensions/action_view/base.rb.
I suggest that there be a second condition attached to the unle...
2011 May 23
0
Fallback for partial_paths on rendering process
Hi, I have an application that uses single table inheritance.
Very simple stuff:
class Place < ActiveRecord::Base
class City < Place
lets say I have a City on the @place
whenever I try using the
render @place
I will get an error, saying the templace cities/city doesn''t exist
but I do have a places/place template.
Is the any nice way to add this fallback for the base_class
2008 May 08
0
stub sub partials when testing partial with rspec
...r, so I made very dirty
and IMHO dangerous function
def block_render_except unblocked
ActionView::Partials.class_eval do
public
def self.set_unblocked partial
@@unblocked = partial
end
alias_method :orig_render_partial,:render_partial
def render_partial(partial_path, object_assigns = nil,
local_assigns = nil) #:nodoc:
if partial_path.to_s == @@unblocked
orig_render_partial(partial_path, object_assigns,
local_assigns)
else
return " "
end
end
end
ActionView::Partials.set_unblocked unblocked
end...
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
2009 Feb 03
1
Passing args to generator
I have some default_options in generator and when I wish to change they
value with --option_name I get only logical true instead of string
...
default_options :option_name => "Some string"
...
def add_options!(opt)
opt.separator ''''
opt.separator ''Options:''
opt.on("--option_name","Some Text") { |v| options[:option_name] = v
2007 Aug 14
12
expect_render, why does there need to be a warning
There is a warning on the web site about expect_render and stub_render:
"WARNING: expect_render and stub_render, while very useful, act
differently from standard Message Expectations (a.k.a. mock
expectations), which would never pass calls through to the real
object. This can be very confusing when there are failures if you''re
not aware of this fact, because some calls will be
2007 Oct 02
19
Per-Request View Paths
I haven''t had a chance to work on fixing multiple controller view paths
recently. My original patch attempt was:
http://dev.rubyonrails.org/ticket/8582
It was rejected due to the fact that it was fixing the symptom more than the
problem.
However, I think it''s critical that this problem get fixed, otherwise the
whole concept of view_paths is severely neutered and