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
2 answers

Rails 4: How to use form_for and partials

I am newbie ruby programmer and I´m suffering this error This is part of my "new" form to create new "Subasta" objects <%= form_for @subasta, url: {action: "crear"} do |s| %> <%= s.label :precioinicial, 'Precio inicial' %> <%= s.number_field…
Marino
  • 106
  • 9
0
votes
2 answers

Two Similar Partials, One Giving Error, Other Is Fine

I have two partials, that are almost exactly the same, except one is a full view, and the other is a compact. They are both under 'projects' view, but one works correctly, and the other gives errors: projects/_project.html.erb
Azketta
  • 79
  • 8
0
votes
2 answers

Partial passing variable error

I have a rails 4 app that has some code like: <% @store.products.each_with_index do |p, i| %> <%= render "product_fields", locals: {product:p, index: i} %> <% end %> and the product_fields partial looks like: //LOTS OF HTML CODE HERE <% if…
the_
  • 1,183
  • 2
  • 30
  • 61
0
votes
0 answers

Render a 'static' container inside a form_for block

I am creating an application form and wanting to embed/render a long text(static html)page "inside" the form as a scrolling container. I've saved the partial in /app/views/layouts directory as _membershipAgreementV_1.html.erb The partial renders…
Stephen
  • 13
  • 2
0
votes
2 answers

Rails: Render for nested forms

I have a nest form that is working great. The form is basically a customer with addresses. I am trying to render a partial at both the customer and address level to indicate who created each record and who was the last person to update the…
DaveInFL
  • 162
  • 2
  • 9
0
votes
1 answer

rails namespace routes and controller

i just can not figure out the best way to handle the routes / controller with the following namespace. i´d just like to have the following setup: .../manage/rooms/ ( <%= @ rooms.number_of_rooms%>, <%= @ rooms.title %> ) .../manage/fuu/ ( <%= @…
oliver
  • 133
  • 2
  • 12
0
votes
3 answers

Rails Partials For Resources

I have a resource called Exercises in my application. I currently have a partial called _exercise.html.erb that I use to render them. I have an outlying case where I'd like to render them in a much different way. Can I make another partial for…
HarvP
  • 190
  • 3
  • 13
0
votes
2 answers

Angular / Nodejs / Jade dynamically display partials

I have a single page that will display multiple partials, depending on the database values. AT the moment i am just using show/hide to display the div however I would like to do it the proper Angular way, I have been having trouble with it though. …
Richard Mc
  • 162
  • 1
  • 14
0
votes
1 answer

Rails render call won't display when called from helper

I have section of code that works when placed in the view, but fails to render when the code is moved to a helper. I know the code is executing because the server shows the render call, but there is no output to the browser. This works (when placed…
0
votes
1 answer

angularjs: how to run view-embeded javascript after partial is rendered

My view (a details itemId partial that lists img tags) is rendered from my controller. The number of img varies depending on the model pointed to by itemId. I need to change the div with which contains the ing tags to # of img x img width. To do so,…
Stéphane de Luca
  • 12,745
  • 9
  • 57
  • 95
0
votes
1 answer

Using SASS, how can I access a variable from a partial file that is defined in base file?

Im new to SASS and have a question, perhaps I'm not understanding correctly. I have my base file (global.scss) and then several partial files. I'm working on a project currently and I want to define a few custom colors to use throughout (as in, I…
Alix Përry
  • 449
  • 2
  • 7
  • 14
0
votes
1 answer

Undefined method 'paypal_url' from a partial

Good evening all, I've been trying to solve this for a while, I'm positive its something very simple that I'm missing... I currently have a web store, it allows customers to add products to a cart, which then allows customers to pay via…
0
votes
1 answer

Rspec testing of a view partial which calls another partial twice with different parameters

Trying to figure out how to test my partial that calls another partial twice with different parameters. I'd like my test to verify those parameters in the two different calls. The two partial calls in the main partial under test:
user2391694
  • 161
  • 1
  • 5
0
votes
1 answer

Form partial error: undefined method `experiments_path' for #<#:0x3313200>

I can't find what I did wrong here, is there something I'm missing? My new action/view here:

Submit a new experiment here!

<%= render "form" %> My _form.html.erb form partial

THis is a form

<%= form_for(@experiment) do |f| %> …
user3408293
  • 1,377
  • 6
  • 18
  • 26
0
votes
4 answers

In an asp.net mvc 4 application should we write forms in partial views or just plain views...?

We have an MVC 4 project in which we have to create about 100 forms. Now the developpers are going to start creating the forms , should we create the forms as views or partial views.. ? Would writing the forms in partial views create any issues for…
Prakash
  • 471
  • 1
  • 8
  • 19