Displaying 20 results from an estimated 21 matches for "taghelp".
Did you mean:
dbghelp
2008 Mar 06
1
Unitialized constant ActionView::Helpers::TagHelper::Set
...simple plugin
require ''rubygems''
require ''test/unit''
require File.dirname(__FILE__) + ''/../lib/meta_tags''
require ''action_view/helpers/tag_helper''
class MetaTagsTest < Test::Unit::TestCase
include MetaTagHelper
include ActionView::Helpers::TagHelper
. . .
end
and when I run rake in the root plugin directory I get the following
error
/usr/bin/ruby18 -Ilib:lib
"/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb"
"test/meta_tags_test.rb"
/usr/lib/ruby/g...
2011 Jan 22
1
uninitialized constant ActionView::Helpers::TagHelper::ERB (NameError)
...command ''rspec collector_helper_spec.rb'' I get the following
error:
**************************************************************************
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_view/helpers/tag_helper.rb:10:
uninitialized constant ActionView::Helpers::TagHelper::ERB (NameError)
from
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require''
from
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require''
from
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/a...
2006 May 23
3
image_tag problem
Hiall,
I want to make an image_tag from within a controller in order to be
able to present a link (with a status image) in a view. Here is my
controller method (in file webca_controller.rb, hence WebcaController)
def untouched_status_image_tag
image_tag("open", { :alt => "Offen", :title => "Offen", :size =>
"12x12", :class =>
2006 May 18
2
attempt to override the ''tag'' method
I want to override the ''tag'' method in
ActionView::Helpers::TagHelper to do some generalized
error handling similar to the way scaffolding puts a
red border around fields that fail validation.
I''ve created a file lib/rails_patches/tag_helper.rb
which contains the following.
module ActionView
module Helpers
module TagHelper
alias_method :o...
2006 Apr 04
6
check_box_tag is limited?
...ams[:checkbox].nil? it just uses the one stored in the session.
However since the check_box_tag is either value or nil I can''t use this
method. Is it just me or does this make no sense? That the check_box_tag
has less functionality than the normal check_box. I am thinking of
modifying the taghelper code so that the tag matches the normal one but
I would rather not deviate from normal rails.
Am I missing something totally obvious or is check_box_tag limited
compared
to the proper check_box helper?
Jeff
--
Posted via http://www.ruby-forum.com/.
2007 Sep 30
2
Outputing to the browser, how?
...tag(:label, label.to_s.humanize)) +
@template.content_tag(:td, super))
end
end
end
From the documentation of content_tag, I see it has two styles:
content_tag(tag, content) or <% content_tag(tag) do %>content<% end %>
http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#M000598
I''d like to use the second style, but I''m not in a view, so, how do I output
to the browser the same way a view does?
Or asking in another way, how do I make this work:
class TableFormBuilder < ActionView::Helpers::FormBuilder
["file_field", "...
2006 Mar 04
13
Using helpers from controllers ?
There is a solution to use helpers from controllers ?
I have an error :
|undefined method `content_tag''|
class ApplicationController < ActionController::Base
def test
return content_tag("a","test")
end
end
2007 Oct 03
2
Providing HTML in an error message generated by validation
All,
I have some validation that I''m doing in a model.
As part of the error message, I would like to provide an HTML link.
What is the best approach to handling this?
APPROACH 1: One way is to
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::TagHelper
in my model so that I can use link_to to generate my link (obv. I could
hard code HTML as well).
But anyway that feels crappy - too much view stuff in the model.
APPROACH 2: A better seeming - approach would be to encapsulate the
generation of the link in a helper method and call that in my mo...
2007 Feb 28
6
DRY question - image_tag :alt and :title the same
Hello,
I have the following:
image_tag(''show.png'', :alt => ''show article'', :title => ''show
article'', :border => 0)
Is it possible that I don´t need to have "=> ''show article''" twice in
this row? e.g. something similar to this pseudo code: (:alt, :title)
=> ''show article''.
2005 Feb 16
4
Beginners Question
I''m just picking up rails...I''ve got a few questions.
First, I''d like to get some input and parrot it back. I''m trying the following in my .rhtml file but it isn''t working. What am I missing here?
<html>
<head>
<title>Search</title>
</head>
<body>
<h1>Search for Filings</h1>
<p>
Use this page to
2006 Jul 13
1
From the Agile book, page 144 regarding a div tag helper
Hi. in the Rails Agile book here''s what was happening:
>>>
module StoreHelper
def hidden_div_if(condition, attributes = {})
if condition
attributes["style" ] = "display: none"
end
attrs = tag_options(attributes.stringify_keys)
"<div #{attrs}>"
end
# format_price method ...
end
Note that we cheated slightly here. We copied code from the Rails
2006 Apr 11
2
Mapping contained objects to forms?
I''m having lots of trouble trying to map an object that contains another
object to the right forms param. So say I have Book which has one
Publisher. Here is what I''ve tried:
<p><label for="book_publisher">Publisher</label><br/>
<%= text_field ''book'', ''publisher.name'' %> </p>
Then
2006 Feb 10
2
How do I test actionview helpers in the console?
I would like to see the output of actionview helper methods, to be able
to play with it.
When I do the following in the console:
collection_select("job", "client_id" , @clients, "id", "name")
I get:
NoMethodError: undefined method `collection_select'' for
#<Object:0xb7cf1970>
I''d like to get something like:
<select
2005 May 27
0
tag, content_tag: are nil-valued options ever useful?
...shows
up as, e.g.
<span class="">
Now, this can be pretty wasteful, but I don''t want to change my evil
ways. Thus I''d rather have the framework throw out these options than
do it myself. AFAICT, all tag generation is funnelled through
ActionView::Helpers::TagHelper#tag_options where nil-valued options
could easily be filtered.
There are two question I''m not clear about, though:
* Is there ever a use for an empty attribute?
* Can it be useful to differentiate between nil and empty as the value
of an option?
Michael
--
Michael Schuerig...
2008 Oct 12
0
How to test with RSpec a Rails plugin using “link_to” and “current_page?”
..., this totally breaks the tests with RSpec.
I''m calling *link`_`to* and *current`_`page?* like this:
def menu(options = {}, &block)
carte = my_menu.new(self)
yield carte
carte.to_s unless carte.empty?
end
class my_menu
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
def initialize(base)
@base = base
end
def link
@base.link_to(name, url_options, html_options)
@base.current_page?(url_options)
end
end
And I get this error with RSpec:
Undefined method `link_to...
2006 Jul 24
2
InPlaceSelectEditor question
I''m attempting to use the example given in the Rails Recipes book chapter 2,
to create a select drop-down using the InPlaceEditor function (modified to
be InPlaceSelectEditor.
The example given works (a country list drop-down), but I''m attempting to
use it to display a list of items generated from an object in another table
that is linked to the table that I''m editing.
2006 Jun 02
6
overriding constants
Hi there,
I''m trying to override the defaults for form_helper.
I can see in action_view/helpers/form_helper.rb:
class InstanceTag #:nodoc:
include Helpers::TagHelper
attr_reader :method_name, :object_name
DEFAULT_FIELD_OPTIONS = { "size" => 30 }.freeze unless const_defined?(:DEFAULT_FIELD_OPTIONS)
DEFAULT_RADIO_OPTIONS = { }.freeze unless const_defined?(:DEFAULT_RADIO_OPTIONS)
DEFAULT_TEXT_AREA_OPTIONS = { "...
2006 May 18
3
populating array of text_fields from an array of model objects
I have in my view the following:
<% 0.upto(@num_performances) do |idx| -%>
<%= text_field ''performance'', ''city'', :index => idx, %>
<%= text_field ''performance'', ''venue'', :index => idx, %>
<% end -%>
and in my controller I have:
@performance = [Performance.new("city" =>
2008 Jun 15
11
[PATCH] helper to create fb css stylized table
I attached a rails helper implementation of the fb_table described here:
http://wiki.developers.facebook.com/index.php/Facebook_Styles
I included testing and comments. I hope you find it useful.
Curiously, it''s really a small extension of FBML.
Richard
-------------- next part --------------
Index: test/rails_integration_test.rb
2006 Jul 22
17
Problem getting form_remote_tag to work with image upload
Hey guys,
I am trying to pass the parameters for the file being upload, but the
params[] are not being passed. Ive read through some posts and realize
this is an issue with RoR.
I read through some of the posts and someone suggested using:
http://svn.kylemaxwell.com/form_remote_upload/trunk/
I tried to install it, and although I thought I installed it correctly,
it doesn''t work.