Questions tagged [renderpartial]

The concept of rendering only a specific part of any UI. May also refer to the .NET `RenderPartialExtensions.RenderPartial` method or the Ruby on Rails `PartialRenderer`

The concept of rendering only a specific part of any UI. May also refer to the .NET RenderPartialExtensions.RenderPartial method or the Ruby on Rails PartialRenderer

391 questions
6
votes
1 answer

Rendering partial inside js.erb. Is it possible to get raw string so I can strip whitespace?

I want to render a partial in my js.erb file so I can use the generated HTML in my Javascript. Here's some code to serve as an example. create.js.erb $(function(){ var html = "<%= render(:partial => `pretty_box`) %>"; …
John
  • 9,254
  • 12
  • 54
  • 75
6
votes
3 answers

Asp.net MVC - Render a partial View From an Area

I've created an area that will handle our some generic things across all our development products, just as log ins, HTML helpers, etc. Inside the area, I have a partial view that I'm attempting to reference outside of the area. I've registered the…
DavidAndroidDev
  • 2,371
  • 3
  • 25
  • 41
6
votes
3 answers

render a partial from jquery and haml

The functionality I plan on doing is to insert some form elements depending on a number chosen from a select tag. I have a select tag called for number_of_passengers, and i plan to dynamically append new passenger fields for the number chosen. Say I…
corroded
  • 21,406
  • 19
  • 83
  • 132
6
votes
1 answer

Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction. can any one please describe the difference

In ASP.NET MVC, what is the difference between: Html.Partial and Html.RenderPartial Html.Action and Html.RenderAction
Nikhil Saswade
  • 167
  • 2
  • 6
  • 16
6
votes
1 answer

Design pattern to integrate Rails with a Comet server

I have a Ruby on Rails (2.3.5) application and an APE (Ajax Push Engine) server. When records are created within the Rails application, i need to push the new record out on applicable channels to the APE server. Records can be created in the rails…
empire29
  • 3,729
  • 6
  • 45
  • 71
6
votes
2 answers

Translate controller action_name in Rails 4

I want to translate my applications' views and as I'm using partial to render headers for each view like this: <%=t "#{controller.controller_name.capitalize} #{controller.action_name}" %> ...I got stucked on translating them. How do I translate…
6
votes
2 answers

Problems rendering a *very* simple partial in a *very* simple app

UPDATE: Feel free to give me negative votes because the issue was that I had named the file _stylesheet.html.erb & not _stylesheets.html.erb. I thought I checked spellings but clearly I did not. I apologize for wasting everyone's time and I…
tundal45
  • 193
  • 3
  • 14
  • 33
6
votes
3 answers

How does the Html Helper, RenderPartial, work? How can I implement a helper that can bring in content from a partial view?

When you use Html.RenderPartial is takes the name of the view you want to render, and renders it's content in that place. I would like to implement something similar. I would like it to take the name of the view you want to render, along with some…
Matt
  • 5,547
  • 23
  • 82
  • 121
5
votes
4 answers

Yii - jQuery not working after renderPartial

I know this question has been asked numerous number of times, both here and in the Yii site, but I am not getting the solution even after going through each solution. I am sure I am doing something fundamentally wrong. So if you are still reading…
Anand Sainath
  • 1,807
  • 3
  • 22
  • 48
5
votes
1 answer

Adding a method to FormBuilder that calls a helper method that renders a partial

So I've got this helper method, right? def table_form_field(name_or_options = nil, *args, &block) # ... render :partial => "snippets/table_form_field", :locals => options end It's nice, except sometimes I want to use it with a form builder, and…
ashrewdmint
  • 588
  • 4
  • 14
5
votes
1 answer

Partial rendering not shown

Rails 3.0.7, Windows 7, NetBeans 6.9.1, JRuby 1.5.1, Ruby 1.8.7 I have app/views/browsing/index.rhtml with this relevant part, focus on the render call: <% colnames =…
Notinlist
  • 16,144
  • 10
  • 57
  • 99
5
votes
2 answers

Calling RenderPartial from an Area

This is my folder structure I wan to call a partialview from my view on my area
Aivan Monceller
  • 4,636
  • 10
  • 42
  • 69
5
votes
2 answers

What is the correct pattern to protect against NullReferenceExceptions in ASP.NET MVC

UPDATE The issue was a syntax issue. @awrigley shows the correct way to write this in Razor. The following works: @if(Model.Thing.Prop != null) { Html.RenderPartial("SomePartialView", Model.Thing.Prop); } You have a requirement to show…
Greg B
  • 14,597
  • 18
  • 87
  • 141
5
votes
1 answer

Add session to fake httpContext in C# MVC project

How can i add the session to a fakeContext ? This function have we build for partial request where the content must be returned as a string. Only we don't have sessions now in the partial request. And i can't add them like fakeContext.Session =…
Marco
  • 2,306
  • 2
  • 26
  • 43
5
votes
2 answers

How to create dynamic, multiple partial views using repository pattern in MVC

I am trying to have a general home page that depending on the parameter passed to the control, different content (modules) will be displayed. For example, a user may select Kentucky from the menu and the id for Kentucky is 1. The home controller…
1 2
3
26 27
<%=I18n.t('browsing.actions')%>