similar to: application_helper can "include" another helper ?

Displaying 20 results from an estimated 10000 matches similar to: "application_helper can "include" another helper ?"

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 completly impossible ? Thanks
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__) +
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
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...
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 ApplicationHelper::FOO? Stu
2011 Apr 08
5
How to extend a helper using plugin?
Hello, I''m facing this problem while trying to extend the parse_redmine_links helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin. My idea is to use alias_method_chain so the extended version could call the original version and adjust the result to it''s liking. Anything I''ve tried so far exposes this behavior: the first render of a page uses the extended
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 Jan 17
6
link_to or helper to generate a javascript:history.back() ?
Hello, There is an link_to option or an helper that generate a link like : <a href="javascript:history.back()">Back</a> Thanks
2006 Apr 06
5
Using helper method of another model
I have a template that belongs to a certain model (model A). I need to call a helper method of a different model (model B). Then I need the helper method of B to call a helper method of model C. I tried using "include" and "require" and using namespaces, but I got "undefined method". What is the way to do it? -- Posted via http://www.ruby-forum.com/.
2006 Jul 20
5
RJS where to put helper method?
Hi, If I want to have helper method for my rjs, where''s the best place to put it? so for example: --- bla.rjs: page.replace_html ... page.visual_effect ... --- somewhere: (currently I put in application_helper.rb) def replace_with_effect(page) page.replace_html ... page.visual_effect ... end --- bla.rjs: replace_with_effect page and is there a way to define the helper so we
2007 Jul 31
11
helper spec not finding rails core helpers
Hi, My helper specs were going ok until I added a call to a rails DateHelper method 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. #
2006 Feb 11
7
Menu Helper
Hi all, I''m trying to add a common menu to all pages in my application. It is just a set of links I want to display. I''m having trouble deciding where to put the code. Below is what I''ve tried to get out of the "Four Days on Rails" tutorial but no luck. Any help would be appreciated. Am I on the right track? Thanks, Sam
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
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.adamfields.com/resume.html ].. Experience [
2010 Nov 29
0
[TDD] [Rails] - Rspec test for application_helper.rb fails when trying to access application_controller method.
In a method named logo in my application helper, I reference an application controller method (current_account) that has been marked as a helper method with the following syntax: helper_method :current_account When I test out the setup in the browser (without rspec), rails is happy with this setup. However, when I run the spec, the spec won''t pass and gives me the following error:
2007 May 28
2
helper with block compile error
HI, i''m trying to write a helper that replaces link_to_remote that accepts a block but it gets a compile error in the template: I don''t know what I''m doing wrong... TIA # application_helper.rb def link_block_to_remote( options = {}, html_options = {}, &block) concat(link_to_remote(capture(&block), options, html_options), block.binding) end # in
2007 Jul 24
4
spec''ing helpers that use controller
Hi all, I''m in the process of creating rspecs for my helpers. One of the helpers in app/helpers/application_helper.rb looks like this: def page_name @page_name || "Define @page_name in #{controller.controller_name}::#{controller.action_name}" end The rspec is simply: it "should something" do page_name end
2006 Sep 03
2
Undefined method "xxx" of a model when calling a helper
Hi all I''m creating a shop page. I have a cart model that looks like the following: class Cart attr_reader :line_items def get_line_item id @line_items.each do |l| return l if l.id == id end end def initialize @line_items = [] end def empty! initialize end def empty? return true if @line_items.empty? false end end And I have some
2006 Feb 02
2
multiple ''render :partial'' in a helper ??
Hi all, I''d like to move some view code to a helper but it doesn''t work because I need to render two partials each time. Q: Is it possible to do this with a helper? Example: ----------------- Before: In the view: ... <% case controller.controller_name when ''member'' %> <%= render :partial => ''shared/member_menu''