Questions tagged [partial]

Existing only in part; incomplete.

Existing only in part; incomplete.

1478 questions
9
votes
1 answer

Local variable always nil when trying to render partial

I'm getting a really strange issue with a partial when trying to render a collection, I've even tried different approaches. Here is my partial code (for debugging):
<%= item.inspect -%>
And here are my attempts to use it: <%= render…
DEfusion
  • 5,533
  • 5
  • 44
  • 60
9
votes
2 answers

partial template specialization for friend classes?

I have a simple class X, and set of templatized classes Y. I'd like all classes Y where the first templatization parameter happens to be X to be a friend of X itself. The following hopefully conveys what I want, but the friend statement gives…
Matthew Busche
  • 551
  • 4
  • 12
9
votes
1 answer

Rails 3 unwanted html escaping

I am converting my fat Rails2 application to run on Rails3. After a long intense fight with an army of bugs and my bosses yells, the page is all rendered as an escaped html string. So all the divs, images etc. are written literally for the user. For…
wael34218
  • 4,860
  • 8
  • 44
  • 62
9
votes
2 answers

Problem with interface implementation in partial classes

I have a question regarding a problem with L2S, Autogenerated DataContext and the use of Partial Classes. I have abstracted my datacontext and for every table I use, I'm implementing a class with an interface. In the code below you can see I have…
Bas
  • 1,232
  • 1
  • 12
  • 26
9
votes
2 answers

Why can't I bind + in clojure?

Can anyone explain why I can rebind list but not +? (binding [list vector] (list 1 3)) (binding [list +] (list 1 3)) (binding [+ list] (+ 1 3)) I'd like to rebind + so I can do partial evaluation.
John Lawrence Aspden
  • 17,124
  • 11
  • 67
  • 110
9
votes
5 answers

load partial with jquery and rails

Im curious about what the best way to load a rails partial with jquery. So far I have tried a solution not working: $('#imagecontent').load('/newsletters/_image_gallery.html.erb', function() { alert('Load was performed.'); }); Is the best solution…
Christian
  • 242
  • 1
  • 3
  • 8
9
votes
1 answer

Does Symfony 2 support partial form binding?

My question(s): Does Symfony 2 have support for PATCH requests, or any type of partial form content submissions? If so, is there a "correct" (or, more accurately "preferred") way to do this? Aside from the PRE_BIND (see below) event approach, are…
Sean Quinn
  • 2,131
  • 1
  • 18
  • 48
9
votes
4 answers

Missing partial modifier on declaration of type 'x' - cause by auto-generated code by designer

The full error description is as per below: And I found a few similar question posted before: A and B But the question in A and B does not provide detail of problem description (perhaps we prompted the same error message but caused by different…
jhyap
  • 3,779
  • 6
  • 27
  • 47
8
votes
2 answers

Zend Framework: what is the difference between partials and placeholders

In Zend Framework, Can anybody explain the difference between partial and placeholder? From my understanding, one can render a particular template / container by using both placeholders and partials. In which condition should one use a partial and…
Neeraj
  • 8,625
  • 18
  • 60
  • 89
8
votes
4 answers

Render View (or Partial) In another project?

i have a solution with the following two projects - MyNamespace.Services and MyNamespace.Web. Web contains a MVC web application. In the Service project i have a EmailService class that takes care of sending out emails to the user. I want to use…
MartinF
  • 5,929
  • 5
  • 40
  • 29
8
votes
4 answers

MVC3 pass @model to partial view

I have two partial views which are exactly the same, but for the @model. @model Project.Models.X @model Project.Models.Y How could I pass this model type to the view so that I can use the same view for both?
TheGwa
  • 1,919
  • 27
  • 44
8
votes
3 answers

Create instance method in metaclass using partial in Python 3

Using metaclasses, I am trying to create an instance method by simplifying an existing instance method. The problem is that partial does not work with instance method. This is a simple example of what I try to achieve: from functools import…
Hernan
  • 5,811
  • 10
  • 51
  • 86
8
votes
0 answers

using Joblib memory library with partial objects

I have a function with two parameters: def foo(x,y): # some complicated math return result and I define partials using the functools library: f1 = partial(foo,1) f2 = partial(foo,2) Now I would like to use the joblib.Memory library to cache…
motam79
  • 3,542
  • 5
  • 34
  • 60
8
votes
3 answers

Ruby on Rails: How to Render Partial in a view via Jquery

I have a 'project' form as a partial. I'm trying to use jquery to render the partial when user clicks a button: $('.projects').append("<%= render partial: 'projects/project') %>").html_safe But using the above code is literally rendering "<%=…
Jackson Cunningham
  • 4,973
  • 3
  • 30
  • 80
7
votes
2 answers

Should you only use local variables in a partial?

Using local variables seems advisable in a partial that could be used application-wide to avoid dependencies across the application. But within a single controller it seems acceptable to reference instance variables that you know will be available…
eggdrop
  • 3,356
  • 5
  • 29
  • 32