Additional functionality not defined in a class that the helper operates on.
0
votes
0answers
6 views
is it possible to read validation rules when building form in rails?
i mean in rails, can i build form by reading validation rules.
my user model:
class User < ActiveRecord::Base
validates :name,
:email,
:sex,
...
0
votes
1answer
17 views
codeigniter force_download() for excel file downloading a corrupt file
Following is the code i am using to force download some files on my server in codeigniter. The downloaded file is corrupt and MS Excel is not able to open it. I don't see any problem with this code. I ...
0
votes
0answers
12 views
Trying to load Action Helper in Zend Framework 1.x
Spent the major part of 2 days reading, trying and researching, even doing multiple tutorials, and nothing works (not my code and not the tutorials). I am simply trying to move some code into helpers ...
-1
votes
1answer
49 views
When methods should be part of a class [on hold]
I am a little confused about what the threshold for creating a class is.
I am currently working on a windows form project where each form has multiple helper functions. I have created classes for ...
0
votes
1answer
13 views
Use a template/block in a helper
I have a helper with this method to get the items in a customer's cart
public function getCartData()
{
//Get cart DATA
$quote = Mage::getSingleton('checkout/session')->getQuote();
...
0
votes
0answers
20 views
Troubleshooting Media helper - player stuck on loading gif
i've been making a media helper fancybox gallery, but i'm having problems... I think the console is working and all the scripts are present, the only problem is that when the thumbnail is clicked the ...
-1
votes
4answers
58 views
How to return multiple strings separated by a space in ruby on rails?
I am using the following view helper defined in my application_helper.rb file:
def even_odd(index)
if index.to_i % 2 == 0
"left_border white"
else
"left_border"
end
end
In my view ...
1
vote
0answers
52 views
Is there a pattern where you have a class whose job it is to instantiate common implementations of another class?
I want to call it a "Helper" but this seems way too general.
Let's say I have a class called WidgetCranker and WidgetCranker can be set up to crank out widgets of the type Square, Keyhole and ...
0
votes
1answer
13 views
How to remove id & name attributes from rails view helper
Rails generates id and name for select_tag from name argument by default:
select_tag "people", "<option>David</option>".html_safe
# => <select id="people" ...
1
vote
4answers
38 views
Method to return multiple bits of text Rails
I am currrently in the process of writing a new rails application and have a div near the top of my page called background that contains an image, a Title and some sub title text.
At the moment I ...
2
votes
1answer
28 views
Codeigniter custom helper for bbcode, apply function on parameter
I made a custom bbcode parser function and added it on my helper
if ( !function_exists('bbcode_parser'))
{
function bbcode_parser($str)
{
$patterns = array(
...
0
votes
1answer
29 views
Where to put “conversions” for database content in Ruby on Rails?
I store the day of the week as an integer from 0 to 6 in the database.
Now when I want to use that data in a view I want it to show as "Sunday", "Monday", etc.
Where should I put that kind of ...
0
votes
1answer
32 views
Directory Map in CodeIgniter - Not working with Integers as directory names
When using the directory_map Helper in CodeIgniter I am unable to get the directory names if they are a straight integer. For example "2013" won't work. But "2013_test" will work.
An example of a ...
1
vote
1answer
10 views
form_for with a select helper using 2 models
I have two models offer and country they don't have any relationship, but in my new offer form, I want a select tag for select the country of the offer.
Here is my new action:
def new
@countries ...
-4
votes
1answer
20 views
Multi Download File Android [closed]
How to download multiple files with method simultaneos in android? For every file I have download option when I am downloading a file and choose another file to download the file should add to list ...