search for: application_helper

Displaying 20 results from an estimated 216 matches for "application_helper".

2005 Jul 22
3
testing application_helper.rb
I am trying to run some functional (or are they unit?) tests on my application_helper.rb. So far, I''ve not had any success in being able to call the methods defined in application_helper.rb. Here is my app/test/functional/helpers.rb require File.dirname(__FILE__) + ''/../test_helper'' require File.dirname(__FILE__) + ''/../../app/helpers/applicati...
2006 Mar 04
2
application_helper can "include" another helper ?
My "application_helper.rb" become to large. I have basic functions that I use for all projects. Is it possible to define thoses functions inside an external "basic_helper.rb" and include it in "application_helper.rb" ?
2006 Nov 27
2
ActionMailer & application_helper.rb
Hi, I''m trying to send some emails with the same formatting as my pages & I can''t seem to access my display routines in application_helper.rb. I''m trying a hack to bypass this. At the top of my ActionMailer notifier script I''ve included application_helper.rb - my understanding is that this should arrive as a module and should be able to be used accordingly. <% require File.dirname(__FILE__) + ''/../../he...
2006 Jun 26
5
using application_helper.rb
I have a simple Yes/No selection list that I am using in a number of places. Thinking that I could DRY things out a bit, I added it to application_helper.rb ... YES_NO = [ [ "Yes", true ], [ "No", false ] ].freeze So I figured I would use it there instead of in each model.rb where needed. anyway, in webrick screen, I am continually seeing this... script/../config/../app/helpers/application_helper.rb:6: warning: a...
2008 May 20
2
DateHelpers .. don' display.. ?
...gt; time_ago_in_words(Time.now, include_seconds = false) => "moins d''une minute" I get the correct answer.. but I I write in my view <%= time_ago_in_words(Time.now, include_seconds = false) -%> I get an error :wrong number of arguments (0 for 1) trace app/helpers/application_helper.rb:96:in `[]'' app/helpers/application_helper.rb:96:in `distance_of_time_in_words'' seems no argument is passed .. ?? what''s wrong in the view ? thanks for your advices -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You...
2005 Dec 19
1
Application.rb / Application_Helper.rb / DRY help
Hi all, I have defined the following method in both application.rb and application_helper.rb: def still_logged_in? !session[:user_id].nil? end This method is called in a before_filter in my application.rb, as well as in my layout/application.rhtml and view/user/login.rhtml (for showing a login / logout button, etc.) I had to put it both places, otherwise I would get an '&...
2005 Aug 16
1
Best way to access constants in application_helper.rb from views?
Hi, I''m using the application_helper.rb file to create some useful functions for generating links by name. I understand that functions defined in this file are available to all views, but what about constants defined in that module? Is there a best practice approach for doing this other than accessing each constant via ApplicationH...
2011 Apr 08
5
How to extend a helper using plugin?
.... Anything I''ve tried so far exposes this behavior: the first render of a page uses the extended version, while every later renders use the original unmodified helper. I''ve tried to include my patch module in the plugin''s init.rb like this: require_dependency ''application_helper'' ApplicationHelper.send(:include, RedminePastebin::ApplicationHelperPatch) Also I''ve tried to define my ApplicationHelper in myplugin/app/helper/ application_helper.rb with the same effect. Both approaches used self.included hook to call alias_method_chain, like this: def sel...
2006 Jan 16
5
A function that return a link_to, Possible ?
Hello, I try this : in application_helper.rb ----------------------- def lnk bla return link_to bla, { :controller => bli , :action => "blo" , :id => "blu" } end in file.rhtml ----------- <%= lnk "yo!" %> This return an error. There is a way to do this or something similar, or this is...
2007 Jul 31
11
helper spec not finding rails core helpers
...ethod in one of my helpers http://api.rubyonrails.com/classes/ActionView/Helpers/ DateHelper.html#M000574 The helper runs fine from my view templates, just dies in the spec test. I boiled my question down to a simple (not too useful) example. I''m not sure what I''m missing. # application_helper.rb module ApplicationHelper def app_foo t = Time.now distance_of_time_in_words( t, t + 50.minutes) return true end end # application_helper_spec.rb require File.dirname(__FILE__) + ''/../spec_helper'' describe ApplicationHelper do it "should find app_...
2006 Aug 13
0
application_helpers, gems and paypal
Hi I''m trying to use the paypal ipn gem in my app but rails can''t seem to find it. I installed using gems and it is listed as being installed. I followed the documenation and put include Paypal::Helpers in my application_helpers.rb but as soonas i try to use <%= paypal_form_tag %> i get undefined local variable or method `paypal_form_tag'' for #<#<Class:0xb76ffa40>:0xb76ff964> Extracted source (around line #24): 23: 24: <%= paypal_form_tag %> Is there something else i have to do...
2006 Jun 07
0
Problem with file_column plugin path and application_helper.rb
Hello, I upgraded my Rails app from 1.0 to 1.1.2. Basically everything worked on my development box. When I uploaded the changes (including the frozen 1.1.2 gems) to my webhost most things worked. However I had a problem with my application_helper.rb file. It wasn''t able to find the url_for_image_column method from the file_column plugin. Here''s the relevant code in applicaiton_helper.rb: # this tag helper creates a image tag for file_column fields that contain images def image_tag_for_image_column(object, method, version,...
2006 Feb 26
0
ActionMailer view templates don''t pick up application_helper.rb?
It seems that helper methods defined in application_helper.rb aren''t available in ActionMailer views. Is that intentional? -- - Adam ** Expert Technical Project and Business Management **** System Performance Analysis and Architecture ****** [ http://www.everylastounce.com ] [ http://www.aquick.org/blog ] ............ Blog [ http://www.ad...
2010 Nov 29
0
[TDD] [Rails] - Rspec test for application_helper.rb fails when trying to access application_controller method.
...;t pass and gives me the following error: Failures: 1) ApplicationHelper#logo image tag should point to logo.png Failure/Error: helper.logo.should =~ /logo.png/i undefined local variable or method `current_account'' for #<ActionView::Base:0x105645108> # ./app/helpers/application_helper.rb:13:in `logo'' # ./spec/helpers/application_helper_spec.rb:21 Current Versions: Rspec Version 2.1.0 Rails Version 3.0.1 I''ve created a gist that shows how my code is setup, and how the helper is calling the controller method: https://gist.github.com/720757 Does anyone kn...
2006 Jan 31
6
How to Affect Plugin Load Order
...39;m using bundled_resource, login_engine, and a few other plugins. It appears Rails considers plugins in alphabetic order. Turns out that there is a particular order that will work and alphabetic ain''t it. The login engine must be loaded first. Bundled resource then includes ''application_helper'' and the application helper includes LoginEngine. If bundled_resource is allowed to load first, when it includes ''application_helper'' the include LoginEngine fails with an undefined constant. Is there a way to change plugin load order? Thanks -- Posted via http://w...
2006 Mar 16
1
application_helper.rb vs application.rb
I find that I want to put the same methods into both of these files. Whats the best way to get away with a single implemenation? Gareth -- Posted via http://www.ruby-forum.com/.
2009 Jul 24
2
[PATCH server] add collapsable sections to vm form
the vm form is getting cluttered, this patch simply add collapsable sections to the form, making the 'storage' and 'network' sections collapsed by default credit goes to jayg for contributing alot to this patch in terms of simplification and cleanup --- src/app/helpers/application_helper.rb | 4 +- src/app/views/vm/_form.rhtml | 35 ++++++++++++++++++++++---------- src/public/stylesheets/components.css | 1 + src/public/stylesheets/layout.css | 11 ++++++++- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/src/app/helpers/application_helper.rb...
2006 May 24
3
using a helper from the console
I''ve got a couple of helper functions in my application_helper file that I would like to run from the console (for debugging). What is the correct way to invoke a helper from the console? _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
2006 Feb 11
7
Menu Helper
...<title>Test</title> <%= stylesheet_link_tag ''scaffold'' %> </head> <body> <%= menu_display %> <p style="color: green"><%= flash[:notice] %></p> <%= @content_for_layout %> </body> </html> helpers/application_helper.rb (This is where the menu logic and display would be) ============================= module ApplicationHelper def menu_display # Security Logic to determine which menu option to display end end controllers/application.rb (linking the helper) ========================== class ApplicationC...
2009 Jul 02
1
[PATCH server] UI for accumulated uptime for VMs. (revised)
...#39;s sorting fix as well as some other changes required to make this work fully on the cloud UI side. --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/resources_controller.rb | 4 +++- src/app/controllers/smart_pools_controller.rb | 5 ++--- src/app/helpers/application_helper.rb | 14 ++++++++++++++ src/app/models/vm.rb | 11 ++++++++++- src/app/views/cloud/instance/_list.rhtml | 4 ++++ src/app/views/vm/_grid.rhtml | 1 + src/app/views/vm/show.rhtml | 4 +++- src/test/unit/vm_test.rb...