Displaying 20 results from an estimated 110 matches for "applicationhelpers".
Did you mean:
  applicationhelper
  
2008 Mar 19
3
ApplicationHelper
When working with views, I use instance methods of ApplicationHelper:
# app/helpers/application_helper.rb:
module ApplicationHelper
  def distribute(total, min, cutof, list)
    [1,2,3]
  end
end
# app/views/planner/_mta_colors.rhtml:
<td>
<%
...
dist = distribute(total_v_px, 4, 0, colors.collect{|color| color[1]})
...
%>
So to test the distribute method in ApplicationHelper, I have
2006 Mar 25
3
Rails Plugins: Why to register your own functionality with send()?
Hi there,
I have seen in the file column plugin (
http://www.kanthak.net/opensource/file_column/) from Sebastian Kanthak or
David''s acts_as_taggable plugin that to register my functionality I need to
do something like this:
ApplicationHelper.send(:include, InPlaceEditAssociations)
I am wondering why not:
(a)
module ApplicationHelper
  include InPlaceEditAssociatons
end
or:
(b)
2009 Apr 12
4
Can't get an Array function to be visible inside ApplicationHelper
Folks,
I seem to be missing something basic here.
I am trying to call a function from my application layout that will
return me a hash of the roles for the user currently signed in. Here
is the simplified code I have in ApplicationHelper module
  class Array
    def to_h
      Hash[*enum_with_index.to_a.flatten]
    end
  end
  def get_cur_user_roles
    ["school_admin",
2006 Sep 29
2
ApplicationHelper is not a parent of SomeHelper?
i have:
# file application_helper.rb
module ApplicationHelper
  def load_components
    @right_sidebar = ''some stuffs''
  end
end
# file user_public/blog_helper.rb
module UserPublic::BlogHelper
  def load_components
    ApplicationHelper.load_components
    @right_sidebar += ''{blog archive}''
  end
end
the problem is, i want to load the
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 07
0
NoMethodError trying to get ApplicationHelper method from a functional test
I am a little confused by the includes I suspect. In the book, it states
that runtime environment will load the directories app, app/models,
app/controllers, app/helpers, app/apis, components, config, lib, vendor and
vendor/rails/*.
However, when I try to access my "current_project" public method, it fails
with a NoMethodError.
What is even stranger is that I can use reflection to find
2006 Mar 12
1
alias_method interferes ApplicationHelper
Hello,
I''m using Ruby 1.8.4 (darwinport), rails-1.0.0 (gem) , Powerbook / Mac
OS X 10.4.5 , Webrick.
How come Rails always raises NoMethodError for my helper (must_fill and
rp or number_to_currency_rp) in application_helper.rb ?
I doubt that alias_method is the culprit, but if i give #
comment then there will be no errors at all ... :/
what am i doing wrong? is it a bug or stupid me? Thx
2010 May 19
2
customized form_for in ApplicationHelper
hello,
I want to make a table within a form by making a new form_tag. The
following code in ApplicationHelper fails:
def tabular_form_for(name, object = nil, options = nil, &proc)
  concat("<table>", proc.binding)
  form_for(name,
           object,
           (options||{}).merge(:builder => TabularFormBuilder),
           &proc)
  concat("</table>",
2006 Feb 12
7
form_remote_upload plugin
form_remote_tag does not support the input type=file.  This is due to
javascript security limitations.  I created a plugin that modifies
form_remote_tag so that if you pass it the option: :html =>
{:multipart => true}, it will submit via an iframe, allowing you to
upload files.  It works nicely with file_column :).  Currently, it
only works with RJS templates (no :update option), and I only
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.
#
2008 Nov 07
0
Error: A copy of ApplicationHelper has been removed from...
Hello.
I just started getting this error but can''t figure out what I did in the
past day that might be causing this:
"A copy of ApplicationHelper has been removed from the module tree but
is still active!"
Apparently, there are others that have seen this -- gathering from a
google search -- but I can''t find any solution.
Has anyone seen this?  Here is what
2009 Mar 21
2
ApplicationHelper::WillPaginate (NameError)
What wrong?
environment.rb
require "will_paginate"
application_helper.rb
include WillPaginate::ViewHelpers
def will_paginate_with_i18n(collection, options = {})
will_paginate_without_i18n(collection, options.merge(:previous_label =>
I18n.t(:previous), :next_label => I18n.t(:next)))
end
alias_method_chain :will_paginate, :i18n
2007 Aug 27
2
issue with edge rails and urls
I just switched our project over to Edge Rails, and I''m running into  
this problem with all of my helper methods that call _url methods:
NoMethodError in ''ApplicationHelper home_link should generate a valid  
home link when User.current and Profile.current is not set''
You have a nil object when you didn''t expect it!
You might have expected an instance of
2006 Feb 09
4
Login_Engine: trouble configuring
Hi Guys,
I''m having some trouble getting login_engine to work. I''ve followed the 
steps in the README file to the letter (I think) with the exception of 
the Mailer stuff and cannot get my application to run. Heres what I have;
module ApplicationHelper
   include login_engine
end
#####################################
require ''login_engine''
class
2006 Jun 21
0
Action Mailer and ApplicationHelper method
Hi,
sorry if this has been asked before, but I couldn''t find any info. Is  
it possible to use application helper methods in ActionMailer  
templates (or methods, in case this is the only way)? All I found is  
one statement in the agile web development book, that ''the regular  
helper methods, such as truncate(), are available''.
Is there any overview which helpers are
2006 Feb 26
0
rescue_action with RoutingError not loading ApplicationController/ApplicationHelper
Why is it that when rescue_action is called with any exception except for
RoutingError, "self" refers to a controller within my application, but when
there''s a RoutingError, "self" refers to an object of
ActionController::Base?  This makes some sense because a "RoutingError"
implies that no controller was found to process the request.  However, I am
trying to
2009 Jan 26
2
Cannot extend class in Application Helper
Looking for some help with extending existing classes.
In a view I have <td><%=h bmevent.node %></td>. I need further
processing on the output and added a helper:
module ApplicationHelper
class String
  def a
    self[ /^[^\0]*/ ]
  end
end
end
and <td><%=h bmevent.node.a %></td> results in an undefined method `a''
for #<String:0xb6c8105c>
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 May 29
2
How to use script/runner
I''ve read the wiki and Agile and can''t find the answer.
When using script/runner I''ve gotten simple model functions similar to  
the -help example to run:
$script/runner ''puts Vendor.find(1).name3''
where Vendor is a model.
However when I try to run a function in a controller it doesn''t work:
$script/runner ''puts
2006 May 13
1
undefined method `strftime'', being called from a partial.
Hi,
I''m having an issue with calling a function that I''ve defined in
ApplicationHelper called format_time:
module ApplicationHelper
  def format_time(time)
    time.strftime("%a %b %d, %I:%M%p")
  end
end
I use this function in my views to format the Time.now that I would have
stored in my tables as a DATETIME.  I''m able to use this function, without
any