Questions tagged [partials]

Partials are often synonym for templates, which can even also be called partial templates.

Partials are often synonym for templates, which can even also be called partial templates.

763 questions
0
votes
1 answer

Rails: Create a form wrapper using partials

I have a form_for in all of my views. Now I need to insert a hidden html input element in all of these views. Is there anyway I could specify a wrapper over form using partials where I take all the form parameters , do my own logic of inserting the…
gnarsi
  • 369
  • 1
  • 3
  • 8
0
votes
1 answer

Undefined local variables in Rails 3 partials after upgrade to Ruby 1.9.3

I know there are several posts on this issue but none of the solutions I've read help here. I've just upgraded from Ruby 1.8.7 to 1.9.3p429 and now, I get undefined local variable in my partials. I am calling a partial (from a partial in case…
DSadaka
  • 76
  • 6
0
votes
1 answer

Rails partial not loading into view?

I have an app in which users have submissions, and folders to store and organize their submissions into. In my view, I display a list of all of the users folders, and ideally when the user clicks on a folder, all of the submissions associated to the…
Tom Maxwell
  • 9,273
  • 17
  • 55
  • 68
0
votes
1 answer

Multiple Partials Using Express-Partials On One Layout

I am using Node.js and ExpressJS 3.0. Moving to 3.0, I found that partials were no longer supported and subsequently found express-partials to provide similar functionality. Looking at the example on the GitHub page, I find…
David
  • 3,831
  • 2
  • 28
  • 38
0
votes
3 answers

How to render partial with different model data to other controller

At this moment I am at products/index page, I have set up layout so now at the left side I have menu where I can choose between multiple categories. These are links, so when I click on them I am redirected to categories controller with specific…
Edgars
  • 913
  • 1
  • 19
  • 53
0
votes
1 answer

showing table twice in partial rails

Newbie to rails, I think i might be overlooking something very simple here, but I am displaying a table twice in a partial, not sure if it's to do with my associations. Here is the Properties controller: class PropertiesController <…
cyclopse87
  • 619
  • 2
  • 11
  • 22
0
votes
0 answers

ng-include works for script partials, but not partials in a separate file

I copied the example of ng-include from the tutorial ngInclude but it doesn't seem to work. I tried defining the templates as script partials (as in the jsFiddle of the tutorial), and it works, but when I keep them as separate files in the same…
0
votes
2 answers

Rails 3.2: How do I split large javascript file into many "partials"?

Using the Rails Asset Pipeline, I was wondering how you can split a large javascript file into many different partials. For example: YUI().use('app', function(Y) { //*=require sub/file_a.js //*=require sub/file_b.js //*=require…
CrazyVipa
  • 927
  • 7
  • 10
0
votes
1 answer

Rails: Access members of a collection in a partial

I have a child object with an alternate partial form. Further to this question, I'm able to render the object using a partial form like this: <%= render 'child_items/alternate_partial', :collection => parent_item.child_items %> But I can't seem to…
Will Matheson
  • 338
  • 1
  • 4
  • 19
0
votes
1 answer

Rails: Render a specific partial (other than an object's default)

I want to render some child items with something other than their default partial (i.e., app/views/child_items/_child_item.html.erb). The default one was scaffolded and it isn't great for public viewing of something, but I still want to keep it for…
Will Matheson
  • 338
  • 1
  • 4
  • 19
0
votes
1 answer

How to ajax reload partial from partials

I have an app in which I different networks have messages. In my network show view I display all the messages in with a partial "overview" which shows a link to the message content. The content of the messages is loaded with ajax inside #detailed…
Starelite
  • 43
  • 6
0
votes
1 answer

Unable to get sync gem working, (nomethod error)

I've been trying to install and use the new sync realtime partials gem, but when it comes to putting the code in my views it all goes wrong. This is my existing code, pre sync. <%= render :partial => "tasks/table", :locals => { :assigned_to => true,…
Callum
  • 38
  • 3
0
votes
1 answer

Passing local variable into partial returns NameError

I am trying to pass the index of something into a partial and am getting a NameError. Right now, this is my render statement and I am able to access builder just fine. <%= render 'my_partial', :builder => form_helper %> But when adding index like…
JuliaC
  • 121
  • 1
  • 2
  • 11
0
votes
1 answer

Rails: Render partial content if parameter is present

I'm trying to conditionally render a section of a partial, if the render includes a particular parameter "has_footer". In _modal.html.erb, I have the following:
0
votes
1 answer

Letting a template and multiple partials add to the layout

First off, let me say that I am familiar with content_for. It's not really what I'm looking for here. I want to allow a template and any number of partials to build up, say, a list of JavaScript files I want to load, and pass them up to the layout…
Twisol
  • 2,762
  • 1
  • 17
  • 17