Questions tagged [partial]

Existing only in part; incomplete.

Existing only in part; incomplete.

1478 questions
6
votes
2 answers

Rails and partials, is there a more efficent way of writing this...?

I've got a partial in a loop like so... <% things.each do |thing| %><%= render :partial => "thingy", :locals => { :something => something, :thing => thing } %><% end %> This just doesn't seem very railsy, I was wondering if there more efficient…
CafeHey
  • 5,699
  • 19
  • 82
  • 145
6
votes
2 answers

Handlebars: transfer information from a page to another page via href

Let's say in Handlebars we have this cards-list.html partial: {{#each data}}
6
votes
2 answers

Haml render multiple partials in layout

How can I make the code indent correctly? app/views/layouts/shared.html.haml: = render :partial => "shared/head" = yield = render :partial => "shared/footer" app/views/shared/_head.html.haml: !!!XML !!!1.1 %html{"xml:lang" => "pl", :xmlns =>…
astropanic
  • 10,800
  • 19
  • 72
  • 132
6
votes
5 answers

What this the best way to ignore unwanted fields in a JSON payload from a PUT/PATCH using Golang?

I have a situation where people consuming our API will need to do a partial update in my resource. I understand that the HTTP clearly specifies that this is a PATCH operation, even though people on our side are used to send a PUT request for this…
Matheus Felipe
  • 2,482
  • 25
  • 24
6
votes
1 answer

Java- Getting Json by parts

Generally is there a way to get a big JSON string by a single request by parts? For example, if I have a JSON string consisting of three big objects and having each size of 1mb, can I somehow in a single request get the first 1mb then parse it while…
user2469133
  • 1,940
  • 3
  • 21
  • 33
6
votes
2 answers

Rails render partial from controller

I'm trying to render different partials into my index view from the controller, depending on the params I receive. I have a simple unless-else condition inside my controller that checks the params def index unless params[:check].nil? render…
parov
  • 1,077
  • 4
  • 12
  • 22
6
votes
1 answer

Hibernate: Projection of a collection returns ArrayIndexOutOfBoundsException

I'm trying to get a partial object back using projection in hibernate, like this: Movie class: @Table(name = "Movies") public class Movie extends Entity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Long…
TimDMeyer
  • 77
  • 5
6
votes
3 answers

Render partial from another model

I have a rails application that models a house. There is a house model that has many parameters and it has_many rooms. A room has a house_id and a name. I've also used http://github.com/ryanb/complex-form-examples to allow many lights and…
Ryan
  • 557
  • 10
  • 18
6
votes
2 answers

Validation not working in partial view

I have an Index page which has two partial views: login and register.I am using data model validation. Login.cshtml @model Project.ViewModel.UserModel
@using (Html.BeginForm("_Login", "account")) { …
6
votes
1 answer

Partial Correlations in R

I am trying to compute a partial correlation in R. I have the two data sets that I want to compare and currently only one controlled variable. (This will change in the future) I have looked online to try to work this out myself but it is difficult…
user1897691
  • 2,331
  • 3
  • 14
  • 12
6
votes
2 answers

Rails render collection in ul li

I have this model called Post, idaelly I would love to use just ONE partial + ONE layout to achieve the following. when rendering a single object, outputs: %div= post.body and when rendering a collection, outputs: %ul %li= post.body %li=…
Mu-An Chiou
  • 113
  • 2
  • 7
6
votes
2 answers

Python: how to use lambda or partial to bind arguments other than the first positional argument

I am having a lot of confusion in trying to use either a lambda or functools.partial to create a new function with bound positional arguments from an existing function. I want to do something like this (which is not behaving as desired): def…
ely
  • 74,674
  • 34
  • 147
  • 228
5
votes
1 answer

Rails JS Response, render both status and template?

In my current rails app I'm using an ajax uploader library that requires you respond with json {success:true} to indicate a file was uploaded successfully. In my app the files are images, and after upload I would like to add this to the page.…
Andrew
  • 42,517
  • 51
  • 181
  • 281
5
votes
3 answers

How can I check if function is a partial?

Is there a possibility to check if something is a partial function in Clojure? It would be best to have something like (partial? (partial + 10)) ? Thanks in advance
Dominik G
  • 1,459
  • 3
  • 17
  • 37
5
votes
1 answer

SpringMVC, jquery, tiles, and partial rerendering

I'm trying to do a partial rendering of my web site, using spring mvc 3.1, tiles 2, and jquery. Here's my spring conf :
Christos Loupassakis
  • 1,216
  • 3
  • 16
  • 23