partial

RoR: fields_for and partials.

hi, i am using nested_attributes for an association of products back to a transaction. I need to add a date to the products model. I would like to add a link to set the date_select to today. here is the view: <% f.fields_for :trans_products do |builder| %> <%= render 'trans_product_fields', :f => builder %> ...

How to get data back from partial view

Hi, I have a partial view (using MVC2 .net) inside a view which is a form. the partial view has a textbox and is strongly typed. The problem is I can't get the textbox data from the partial view when I post back, for some reason I can get all the view data inputs on the controller but the partial view, doesn't return the textbox data. ...

Is there any Rails function to check if a partial exists?

When I render a partial which does not exists, I get an Exception. I'd like to check if a partial exists before rendering it and in case it doesn't exist, I'll render something else. I did the following code in my .erb file, but I think there should be a better way to do this: <% begin %> <%= render :partial => "#{dynamic_part...

Access Other Entity Collections from Entity Partial Class

I have an entity class that has a property that contains a business code. I would like to add a property that will contain the description of that business code. To do this it will require that I query another entity collection, but the entity collection doesn't seem to be accessible in the partial class of the entity. I can't solve t...

how do I load partial pages in lightbox using ajax?

hi all, thanks for coming in and looking at my question. I have a page that has a bunch of dynamic a tags with ids like aTag1, aTag2 ans so on. now I need to make these tags open the same lightbox that initially loads a partial page named register.php, and the user will fill out the form, sumbit it then go to another partial page name...

How to persist the values of dynamically created partial view of radio buttons?

I have a survey form. The questions and options are generated from the database. There are 5 questions in the form, each are generated using the partial view. The question is a partial view and the options are templated view. The problem is when submitting the form and the user did not select an answer, it will show a validationsummary...

Zend Framework - How to implement partials which contain logic

Hi I have a layout which works fine. This layout contains several partials, which display adverts, a side column a slideshow, etc. All of these are likely to change depending on which page (module/controller/action) of the site you are on. What is the best way of doing this correctly? In the past I have assigned variables to my view in...

avoiding iframes, but having some iframe like activity in Rails

I have two sites, my main site and a help site with documentation. The main site is rails but the other is simple a wordpress like blog. Currently I have it being pulled into the main site with an iframe, but is there a good way to pull in the html from the other site as some sort of cross-domain (sub-domain actually) partial? Or shou...

How to restore information about partial class from DLL?

DLL contains partial class DisPart defined in two places: public partial class DisPart { public static string s; } public partial class DisPart { public static int i; } Disassembling the DLL in Reflector results in: public class DisPart { public static int i; public static string s; } Is there any possibility to r...

How to organise large code files?

I am increasingly aware that my code in any single file can often span hundreds of lines quite easily and although I know the implementation might be sound, it still feels messy and unorganised. I understand that there are situations where a lot of code is neccessary, but whats the best way to organise it all? I've thought about separa...

Haml render multiple partials in layout

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 => "http://www.w3.org/1999/xhtml"} %head %title some title %body .container app/views/shared/index.html.ham...

clever universal form partials in rails

I have a widget for currencies which I use throughout my application. Ie. the user changes the currency from EUR -> USD, or about 13 other currencies. I have a few other use-cases such as dates but this one is the easiest to explain. Currency basically just updates a session variable by calling the currency controller and then uses so...

How to pass progress to MVC page

I have a delegate method with is called periodic while WritingAnObject uploading the file. I would like to update div (ProgressUpdate) in my MVC page with args.PercentDone value. I appreciate any idea? Thanks, //delegate method private void displayProgress(object sender, ProgressArgs args) { //Console.WriteLine(args.Percen...

Symfony 1.4 - set template for component / partial

Hi everyone! I'm trying to set a different template for components/partials, but nothing works. Here is the problem, the pattern is in another folder, not a folder module. Can I somehow set the template for a component/partial from another folder? ...

jQuery across models in Ruby on Rails

Hi all! I have this rather simple Ruby on Rails application : two models Lists and Items. Lists have many Items and Items belong to Lists. OK. The show method of ListsController prints a page with the list of the items belonging to the given list (in a partial lists/_listOfItems.html.erb). At the end of the show.html.erb view, there is...

Creating functools.partial *args & *kwargs from parsed strings

I am being passed lists of strings that I would like to convert to method calls using functools.partial: [ 'object1.method1(arg1, arg2, 4, key=value)', 'object2.method2(6, arg1)' ...] It's easy to use a regexp to generate the necessary 'func' argument to functools.partial, but I'm having a devil of a time easily converting the string ...

symfony : how to execute an action via a _partial

Hello, in my application, I have a menu which is a partial (_menu.php) I need in my menu which is on the entire application, to have access to that : $this->user = $this->getUser()->getGuardUser(); $this->unread = Doctrine::getTable('sfSocialMessageRcpt')->countUnreadMessages($this->user); But how to create an action for my partial...

How should I comment partial Python functions?

say I have the following code: def func(x, y = 1, z = 2): """ A comment about this function """ return x + y + z another_func = partial(func, z = 4) What would be the correct or Pythonic way of documenting the another_func function? ...

Rails 3. Using ajax on a rendered partial. Please help!

Hello! I am using Rails 3 to load a partial (form) into another page with the code below. The problem is that I want to use :remote => true on the form and use ajax upon it (validation) etc. $("#form_open").bind("ajax:complete", function(et, e){ $("#form_area").html(e.responseText); $("#form_open").html("Add contact informatio...

How to render a partial in a plugin from a plugin helper

I have a helper in my plugin test_plugin/lib/test_helper.rb: module TestHelper def test_render render 'test_plugin/test_partial' end end I have a partial test_plugin/app/views/test_plugin/_test_partial.html.erb: <p>Hello World!</p> In my application app/views/tests/index.html.erb when I do this: <%= test_render %> I get ...