similar to: Partials shared between multiple controllers

Displaying 20 results from an estimated 20000 matches similar to: "Partials shared between multiple controllers"

2012 Jul 19
6
Rendering Partial
I am a bit confused when coming from layout and partials. To start of I have a file called application.html.erb which has my layout such has follow <html> <head> <body> <%= render ''layouts/footer'' %> </body </html> This call a new file _footer.html.erb This file his has follow <footer class="footer"> <nav> <%=
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 Jun 25
6
Understanding Common Views
Hi Everyone, I''m trying to formulate my thoughts on how views work in RoR and I understand the basic bits - 1. Every controller has its own view defined using rhtml files in the views/[controller_name] folder. 2. There is one "view" file (rhtml) for every in the controller and has the same name as the method. 3. For portions that are common, partials can be used - file
2007 Nov 23
4
How to pin down location of views/shared directory ?
My app has a header & footer I want common to each section. They live in app/views/shared/_header.rhtml & _footer.rhtml. They are referenced by app/views/layouts/application.rhtml as one would expect: <div id="header"> <%= render :partial => ''shared/header'' %> </div> They contain many lines like this: <a
2009 Aug 13
5
First hit on app takes a long time
So, I''ve deployed my first rails app, however I''m the only one hitting it for now. I''ve noticed that the first time I hit the app after some long period, it takes a really long time to respond (2-3 seconds). After that, it''s very fast. At first, I thought it might be my VPS "waking up" from some sleep state, but Rails does log the long load time
2008 Sep 17
2
Layouts and content_for
when i studied the tutorial about layouts & content_for from railscast.I need a clarification as per their tutorial. url:http://railscasts.com/episodes/8-layouts-and-content-for <!- projects/index.rhtml -> <% content_for :head do %> <= stylesheet_link_tag ‘projects’ %> < end %> <!- layouts/application.rhtml -> <head> <title>Todo List</title>
2006 May 23
11
adding layouts within layouts
Hi, I want to be able to have several layouts within each other so that I don''t have to keep repeating the layout code for one, in another. An example would be having a layout for the title of your web page and then having an embedded layout for the body portion in which the HTML for whatever view gets displayed. Is this possible? Thanks. -------------- next part -------------- An
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 May 21
2
Nooby partials / component problems
I''m stumped on what seems like should be a fairly easy thing, so I hope someone can point out my error. I wanted to show a few things on every page, so I added an application level template in "layouts". I added my styles in there, and put the controller name and action name into the TITLE tag for my own reference. So far so good - works like expected. Then I wanted to
2006 Aug 18
7
Rewriting URLs - help needed
Hello - I''m grappling with some tricky URL rewriting with Apache 2 and mod_rewrite, and could use a hand. Briefly: URL for application is: www.servername.com/path/to/app/ There is no Alias directive; the application is in the directory /www/content/path/to/app/ on the server file system. The FastCGI dispatcher (dispatch.fcgi) lives at: /www/fcgi-bin/path/to/app/dispatch.fcgi Inside
2006 Apr 12
4
CSS and Javascript with partials and layouts
Hi, I''m developing an application that uses a layout called main on every page. Most of the individual pages are represented with a single partial template, but there are several pages that are composed of multiple partials. My main layout looks something like this: Code: <html> <head> <title><%= @title %></title> <%= stylesheet_link_tag
2005 Dec 28
3
[Templates] [Noob] templates across controllers?
Fine Rails Hackers: I am trying to decide how to approach a templating concern. I would like to define a standard template for all of my pages (including a basic header, styles, footer) across my five base controllers: desktop, events, financials, and records, account. Is there a top level place to declare a template across the entire application regardless of the controller? I understand how
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
2006 Jul 24
8
Views in one controller reaching out to other controllers (best practices)
Hello all. For the purpose of my question, let''s imagine we''re building some search functionality. You''re a sales person (you poor sap). And you''re hanging out in the SalesCenterController. You need to do a search for available productions; you''ve decided to be cool and use Ajax. Do you... a) Make a remote call to an action in your current controller
2011 May 21
2
How do you create a sub-layout or a partial that wraps a lot of custom html?
Basically I''d like to create a layout inside of a layout using erb. Something like this: <%= render :partial => ''support'' do %> <div id="helpDocumentView"> <h3><%= @help_document.question %></h3> <%= @help_document.content %> <div id="helpDocumentHelpful" data-help-document-id="<%=
2007 Mar 12
5
Clarification of how controllers and views work together...
Hi, So I''ve started mucking about with Merb. I''m doing some experimenting with some product ideas. Things are working out quite well, Merb is a pleasure to use. It seems very fast too. A couple of rough spots but that might be me, if they are still chaffing after a few more days I''ll mention them. One thing... I wrote a controller and a view with several
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:
2010 Nov 30
4
Cucumber+Capybara rails 3 issue (Don't know where exactly)
When I''m executing cucumber tests, I noticed that sometimes rails app (in test env.) getting several the same requests (GET or POST) usually around 3, and it doesn''t render anything with empty HTTP status code. Have anyone met something similar to that issue? here is some example of log file: Started POST "/account" for 127.0.0.1 at 2010-11-30 22:34:17 +0200
2006 Jan 15
7
Include extra partial in layouts
Hi all, Does anybody know how to include a partial (next to @content_for_layout) in a layout file? I''m looking for a something like @partial_for_include => ''filename'' in my layout files. So a linked .rhtml file gets picked up from within a layout file. All my layout files (4 at the moment) have a <div class="navright"> tag, so one change in the
2006 Mar 20
1
AJAX in conjunction with partials
All, Trying to clear up some confusion on my part. If I make an Ajax call using Ajax.Request and in the controller method that I call, I do a render (:partial => ''whatever.rhtml''), should I expect that ''whatever.rhtml'' will be rendered in the browser or not? Put another way, is it in any way reasonable for me to think that Ajax.Request + partial render