Displaying 20 results from an estimated 80000 matches similar to: "Layout context"
2006 Jan 13
0
Layout not rendered when render_component used
Hi
I''ve got a login action that handles authenticating users, setting
cookies and, via its view, displaying an HTML snippet containing a form
with username and password fields. It''s called from the main
application.rhtml layout so I don''t need to have a seperate page (away
from the main site) with a login form.
My user model is more-or-less the same as in the Agile RoR
2006 Feb 26
1
Layouts for static pages
Is there any "standard" way if I wish to use a layout with an otherwise static
page? Do I have to create a controller "and everything" for this to work?
Thanks
David
2006 May 21
3
Where to put partials called from the application layout
Hello,
My main application layout, app/views/layout/application.rhtml looks
like this:
something
render partial_1
something else
render partial_2
something else
render partial_3
The partials are not really doing anything, i use them to keep the
layout modular (i.e . to have ~30 lines instead of 200). Now, the
question is where to put _partial_1.rhtml, _partial_2.rhtml,
_partial_3.rhtml.
If i am
2006 Mar 02
3
plugin versioning
When I install a plugin, does Rails record the version installed anywhere?
Maybe I''m not doing it the "right" way, but I''ve excluded vendors from my
source repository. I''d like some ''record'' of what plugins are used that is
under source control.
David
2006 Jun 19
2
Partials from a master layout?
Hi
I am using a ''master'' layout in my project by putting "layout ''main''" in
my application controller so that the same layout is applied to every
controller and I would like to use partials in the layout file (obeying
DRY, of course!) but if I render a partial in the layout then whenever
the layout is rendered by a controller the layout looks for
2006 Feb 26
7
LoginEngine problems
I''m trying to get a simple authentication system going for a small rails app.
After much research, it looks like LoginEngine should do exactly what I want.
Now, the documentation is somewhat confusing to me when looked at in the light
of reality. There are some places that say you have to install the "engines"
plugin. But, I cannot find such a beast.
So, I installed the
2006 Nov 07
0
rxml template accidentally rendered within html layout
Hi,
I have the following in my controller:
def show
@quest = Quest.find(params[:id])
respond_to do |format|
format.html
format.xml
end
end
And in my routes:
map.resources :quests
I have two views for this action, quests/show.rhtml and
quests/show.rxml. Now what I would expect as a response to
''/quests/1.xml'' is that Rails sends, as XML, the rendered rxml
2006 Feb 06
1
template choice error (layout.rb)
Hey,
I installed the rjs plugin yesterday and started using it for one set
of views. Today I notice that in an entirely separate
controller/template I''m seeing this error:
TypeError (can''t dup NilClass):
/vendor/plugins/javascript_generator_templates/lib/add_rjs_to_action_controller.rb:41:in
`dup''
2007 Nov 01
1
How to pass data from a view to a partial rendered in a layout?
In the application I''m working on, a layout renders a partial that
displays a breadcrumb navigation bar across the top of a page. In
other words, the layout renders a partial that displays breadcrumbs.
But the navigation bar rendered by a partial in a layout needs to use
data from the view to determine which breadcrumbs to display.
My question is: how can data be passed from a view to
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
2006 Feb 05
4
Another layout question - Layouts on a per method basis - Layouts with AJAX
I feel I am very close to understanding how layouts are used in Rails:
Q1. I know one can specify a "default" layout for all methods in a controller by specifying
layout ''my-default-layout''
How can this be overridden for individual methods so when those methods are called/executed, the overridden layout will be used. Is this possible?
Q2. With no
2008 Mar 12
2
RSpec view test for :partial with :locals?
I''m currently working on some RSpec view tests and I''m having problems
with expect_render. Most of the expect_render''s work fine, but in one
of my views I have:
<%= render :partial => "user_cloud", :locals => {:user =>
@featured_user} %>
I see that expect_render supports ":object" or ":collection" for the
second
2005 Aug 08
5
In-Line List Editing with AJAX
I''m trying to write an interface for editing many-to-one relationships
with AJAX. Picture the to-do editor in Backpack (and, to a lesser
extent, Basecamp) and you''ll have a good idea of what I''m trying
to do.
I''ve almost got everything working: the ''edit'' link hides the stored
data and replaces it with a form, and the data is updated in the
2008 Jan 13
2
How to set a controller''s layout?
I''d like a controller to use a specific layout for all its views.
Right now I''m calling `render :layout => ''foo''` in each method, but
there must be a better way. I tried
class Users < Application
layout ''foo''
end
And that definitely doesn''t work. Then, as a test, I tried setting
_layout within a method, like this:
def
2010 Jun 27
0
Rails layout generator not doing what the documentation sais it should be doing?
Hello,
I''ve just started playing around with the Rails 3.0.0.beta and I came
across some seemingly strange behaviour, where I expected:
"In previous versions of Rails, the rails generate scaffold command
would automatically create a controller specific layout, like app/
views/layouts/posts.html.erb, for the posts controller. However this
has been changed in Rails 3.0. A application
2006 May 03
3
One layout for entire App ?
Hi,
Being true to DRY, I know in Rails it is possible to define a single
layout associated to a controller and all associated views, lists etc..
by the layout name taking on the name of the controller but is it
possible of a layout to be shared between many controllers ?
TIA,
Tuka
PS: I accidentally posted this in the Test forum.. so I moved it here to
get a pertinent reply
--
Posted via
2007 Jul 28
2
specing a call to render :layout => "some_layout"
I''m trying to specify that an action should be rendered with a given layout
one particular spec.
What I''ve got at the moment is this.
it "should render with the grabber layout" do
controller.should_receive( :render ).with( :layout => "my_layout" )
do_get
end
This doesnt work even though this call to render is being executed.
render :layout
2006 Feb 22
2
self.use_instantiated_fixtures
Can this be controlled on a per TestCase basis, or is it only a global
setting?
David
2006 May 18
3
Render layout on the fly
Hi guys,
i was wondering if there is any possibility to render a layout on the
fly instead of putting it into the layouts/ folder. Any ideas?
--
Posted via http://www.ruby-forum.com/.
2006 Aug 17
1
Disable rendering of layout using a GET parameter?
Hi all
Is there some sort of a built-in possiblity to disable the rendering of
the layout using a GET parameter?
Something like
:url_for :controller => :news, :action => :show, :id => news_item,
:layout => false
This should construct something like that:
/news/show/123&layout=false
And automatically the layout wouldn''t be rendered. Is this already
built-in, or