helper

Helper in order to copy non null properties from object to another ? (Java)

Hi, See the following class public class Parent { private String name; private int age; private Date birthDate; // getters and setters } Suppose i have created a parent object as follows Parent parent = new Parent(); parent.setName("A meaningful name"); parent.setAge(20); Notice according to code above birth...

Where is a good place for a commonly used method... in rails

I have a method that I've started to use in multiple models for Webscrapping, where is the best place to keep it? Should I put it in the application_controller, application _helper? I'm not sure where a good place is to put it for multiple models to use it? def self.retryable(options = {}, &block) opts = { :tries => 1, :on => Ex...

awesome_nested_set

I have a select input: f.select :category_id, nested_set_options(Category, @categories) {|i| "#{'-' * i.level} #{i.name}" } What is the most efficient way to show only the categories with level > 1 ? ...

Calling helper function in Evaluate/Modify (Ctrl+F7) window

Lets say i wrote helper for TStringList TslHelper = class helper for TStringList function DoSth: boolean; end; Then ive included this helper (unit in which helper is defined) in unit i want to use it. During debugging i hit Ctrl+F7 and i want to evaluate: someStringList.DoSth I cant get it to work. Is it possible? Regards ...

In Cakephp using a helper to set template variables

Is it possible to set a template variable in a helper? Ultimately what I'm trying to do is have a helper add in code to the header of the layout, for use with javascript and such. Ways I can think of that I'd prefer not to use: Passing in the view object: don't want to worry about having to call an extra function using the "global" k...

What are the must-have helper classes for a ASP.NET MVC Web Application?

I want to know the must-have helper classes to make an MVC application as decoupled as possible without being ridiculous. Below I am listing the helper classes available from the NerdDinner.com ASP.net sample application showing off MVC Framework. ControllerHelpers.cs FileNotFoundResult.cs HandleErrorWithELMAHAttribute.cs MobileCapab...

How do I use helpers in rake?

Hi, Can I use helper methods in rake? Thanks. Sam ...

output_buffer is null on helper spec

I am trying to test the html block method inside the rails helper: def dashboard_widget(header, &proc) concat('<div class="dashboard-widget">') etc end The code works perfectly in the development environment, but the following test is failed: it "should be created" do helper.dashboard_widget('My widget') do "hello world" ...

other alternative texthelpers in rails

I have text input I get from a variety of sources which is not HTML but is simple text. I've tried using Redcloth to fit this with HTML tags to that it integrates nicely into my site, but it doesn't get bullet points or paragraphs... I checked around an found some text helpers built in, but those also didn't do the job. http://api.ru...

rails number_to_currency bug?

Hi, I have a rails app (rails version 2.1.0) and today I found a very weird error. A money value(mysql decimal column with precision 8 and scale 2) is 86.02. However, number_to_currency method returns "$86.20". This happens only in production server. My dev server returns correctly. The production server is red hat and dev is ubuntu. ...

html helper html.dropdownlist in asp.net mvc

give me full demonstration of html.dropdownlist how it is implimented? how to set values in the list? how to use it in .aspx and in controller file? ...

Is there a helper to know whether a property has been loaded by Hibernate?

I need a helper to know whether a property has been loaded as a way to avoid LazyInitializationException. Is it possible? @Entity public class Parent { @OneToMany private List<Child> childList; } @Entity public class Child { } "select distinct p from Parent p left join fetch p.childList"; // Answer goes here // I want to avo...

Helper for Enterprise Library version 4.1

Hi all, any helper class for reduce code lines using ent Library: Database db = DatabaseFactory.CreateDatabase("ConnectionStrings.Oracle.D04PES01"); using (DbCommand cm = db.GetStoredProcCommand("TBL_POC_TEST_TIPOS.TBL_POC_TEST_TIPOS_FBY_PK")) { db.AddInParameter(cm, "P_ID_TEST_TIPOS", DbType.String...

Passing a view model to helper class

I would like to display a tag cloud in my test application using a helper class to create the html. I can use a for each loop in the partial view to visit each item in the model Inherits="System.Web.Mvc.ViewUserControl < IEnumerable < MyTestproject.Models.TagCount > > foreach (var item in Model) { } But when I try to pass the model...

cakephp + cache + formhelper inside <cake:nocache></cake:nocache> = error

in all my views i have a login/register (cake)form. my question: can i use the file cache engine with <cake:nocache>form</ cake:nocache> 1.) open url "www.domain.com/home" 2.) cachefile generated 3.) look perfect 4.) refresh (f5) 5.) error (when debug=1): Parse error: parse error in C:\xampp\htdocs\cake_1.2.3.8166\app\tmp\cache\...

Where should calculation logic go in a Rails app?

Hi all, I have an app that models a House. The House has_many Rooms, Rooms has_many Lights and Small_appliances, etc. I also have a controller called Calculator that is how the app is accessed. Data is added to the house (and its rooms) using the Calculator controller. Then a report is generated, which is located at app/views/calculator...

Prevent image caching in rails on a per tag basis

We are using gravtars for a site currently being developed in rails 2.3.4 and i am finding that the rails side tends to cache the images even after there is a change at the gravtar side. I know with javascript you can prevent caching when using thejavacript_include_tag :cache => false method, however, is there a way to prevent the cache...

specifying date format when using $form->inputs() in CakePHP

hi all, I am wondering if there is a way to specify the date format in the forms created using CakePHP's $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() that will create the whole form fields automagically. Any input will be appreciated. Thanks. ...

How does Url.Action work Asp.net MVC?

This is somewhat related to another question i've asked but i figure why not ask it seperately. If i were to place something like the following in aview <td><img src='<%= Url.Action( "DisplayImage" , "User" , new { id = item.id} ) %>' alt="" /></td> Is it supposed to display this <td> <img src='/User.mvc/DisplayImage?id=U00915441...

Pagination Helper Customizations (styling)

I'm using the PaginationHelper and in my view I need to set the class for the current page's link to "current number" and I also need to get rid of the | characters before and after the pages. I can set the overall class but not the current page class using: <?php echo $paginator->numbers(array('before'=>'','after'=>'','class'=>'number...