Displaying 20 results from an estimated 10000 matches similar to: "ActionView::Helpers::SanitizeHelper.sanitize docs"
2011 Apr 19
1
RSpec/Webrat Checking output is properly escaped
I want to test that the JSON response from a create action is
sanitized properly, but rspec or webrat appears to be parsing the
output into proper HTML chars instead of escaped characters. I have
verified that it escapes properly in the regular browser json
response.
The relevant RSpec test code is:
include ActionView::Helpers::TextHelper
include ActionView::Helpers::UrlHelper
it
2008 Feb 01
4
How to sanitize _before_ going into the database?
I use a call to the sanitize method every time I render some user
input, but it would be much nicer if I could clean it up once before
putting it into the database and avoid having to call the (relatively
expensive) sanitize every time I render a page.
My first thought was to just add something like:
def message=(x)
self[:message]=sanitize(x)
end
However, the sanitize helper cannot be called
2009 Nov 26
9
ActionView::TemplateError (can't convert ActiveRecord::Error into String)
I cannot work out why this error is appearing.
ActionView::TemplateError (can''t convert ActiveRecord::Error into
String) on line #3 of app/views/button/_show_enquiry.html.erb:
1: <h1>Send us a message</h1>
2: <% remote_form_for :enquiry, :url => {:action => ''send_mail''} do |
f| %>
3: <%= error_messages_for ''enquiry'',
2011 Jun 26
1
ActionView::Template::Error (Cannot modify SafeBuffer in place):
Hello,
Trying to upgrade an app that was running fine in 3.0.3 to 3.0.9 and
while everything works well, I get this error:
ActionView::Template::Error (Cannot modify SafeBuffer in place):
When passing a string to this function (in application_helper.rb)
through a simple: <%= format_me(article[shortdesc])%>
def format_me(text, html_options={}, options={})
text =
2013 Feb 28
1
Make `ActionView::Helpers::InstanceTag#tag_id`, `ActionView::Helpers::InstanceTag#tag_id_with_index(index)` public?
As I asked in StackOverflow<http://stackoverflow.com/questions/15127658/hoe-to-get-tag-id-from-a-record-in-form-for/15129741>
I think it would be helpful since we can dynamically create javascript code
to control each input tag in form helper, what do you think? Or there has
already been a solution?
--
You received this message because you are subscribed to the Google Groups "Ruby
2006 May 30
2
Wrong Content-type in RJS with Gettext
Hello,
I am developing an application using Rails and doing l10n with
ruby-gettext.
When I deploy the app on lighttpd, every rjs template is rendered with
Content-type: text/html; charset: UTF-8. I believe it comes from 85th
line of
rails.rb script in ruby-gettext lib. RJS templates are not executed in
this situation.
Hovewer, when I run the app with Webrick, rjs templates are rendered
with:
2006 Sep 04
1
Overriding ActionView::Helpers::InstanceTag::DEFAULT_TEXT_AREA_OPTIONS
What is the best way to override some of the FormHelper default
options? Right now I''m adding this to the beginning of my
environment.rb:
ActionView::Helpers::InstanceTag::DEFAULT_TEXT_AREA_OPTIONS = { "cols"
=> 80, "rows" => 5 }
Is that the way it''s supposed to be done?
--~--~---------~--~----~------------~-------~--~----~
You received this message
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
2008 Mar 06
1
Unitialized constant ActionView::Helpers::TagHelper::Set
Hi all,
I write the following test to a 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
.
2006 May 19
1
how to access ActionView::Helpers::JavaScriptHelper::escape_javascript in a model (a newbie question)
Hi all,
Please forgive me for this newbie question. But I really want to know how
how to access ActionView::Helpers::JavaScriptHelper::escape_javascript
method in a model.
I can access this method in view, but when call it in the model, it ends up
with undefined method.
It seems to me they are in different scope.
So what''s the best way to access view helper methods in model.
--
2005 Dec 19
0
ActionView::Helpers::FormHelper.text_field
Hi,
Is it possible to use the ActionView::Helpers::FormHelper.text_field with an
instance variable instead of a model. e.g.
In the controller:
def meth
@value = ''hi there''
end
In view:
<%= text_field ''value'', nil %>
It doesn''t work with what is above (doesn''t like the nil) and produces very
strange results replacing nil with
2010 Oct 15
2
include ActionView::Helpers in Rails 3?
How do you do the equivalent of:
module MyLibrary
include ActionView::Helpers::AssetTagHelper
end
...in Rails 3?
I''m trying to upgrade my app from 2.3.9 to 3.0.1 and I have some stuff
in /lib that needs to include these helpers from ActionView. It works
fine in 2.3.x, but in 3.x it''s giving me the error:
undefined local variable or method `config''
One of the
2009 Sep 14
0
markdown call prompts "uninitialized constant ActionView::Helpers::TextHelper::Markdown" in upgraded application
Hey All,
I''m attempting to upgrade my app from rails 2.0.2 to 2.3.3. One bit that''s failing is this call here (in /views/projects/show.html.erb)
<%= markdown(@project.description) %>
That earns me a:
uninitialized constant ActionView::Helpers::TextHelper::Markdown
On that line.
I''m on a rebuilt machine (windows xp, ruby 1.8.6) so I thought it was a
2012 Sep 03
0
time_zone_options_for_select method in ActionView::Helpers is not DST aware
We are using time_zone_options_for_select for the letting the user to
select the timezone to assign to an object.
But we are having trouble because currently we are on DST period, so in utc
-5 but the list is showing utc-6 (the normal offset)
As per usage suggested in this issue:
https://github.com/rails/rails/issues/7297.
I wrote a custom method to solve this
temporarily:
2007 Jan 24
0
ActionView::Helpers::InstanceTag#to_date_tag help
I''m trying to read through the code, hoping to find a way to custom
style select boxes for a date_select and can''t figure out this code.
Any help appreciated:
<code>
def to_date_tag()
defaults = DEFAULT_DATE_OPTIONS.dup
date = value(object) || Date.today
options = Proc.new { |position| defaults.merge(:prefix =>
2005 May 17
2
Noob - ActionView::Helpers::FormOptionsHelper::select
Hi,
I''m just starting with Rails and i''m trying to do something like this:
<%= start_form_tag :action => ''add_user'', :id => @social_event_group %>
<%= select ''user'', ''id'' , User.find_all.collect {|u| [ u.login, u.id ]
}%></p>
<%= submit_tag "Add User" %>
<%= end_form_tag %>
2006 Apr 08
2
ActionView::Helpers::FormHelper instance methods should take an object reference rather than an object_name.
Hi
ActionView::Helpers::FormHelper methods (e.g. #text_field,
#check_box...) take object_name as an argument. From this argument
they infer a name that is supposed to contains the reference to the
relevant object.
I can''t see why the FormHelper methods were designed that way.
Compared to simply passing them a reference, the current way seems too
complicated and an invitation to problems
2006 Feb 09
2
#3775 - testing helpers which use ActionView methods
http://dev.rubyonrails.org/ticket/3775
I''m hoping someone will pop up and tell me I''m simply daft with this
ticket (and queries on IRC, and a prior post to the main Rails list),
but I can''t get a peep out of anyone so far.
The question is, how do I write a simple test for a helper method which
calls ActionView methods itself. E.g., a foo_link() helper which calls
2008 Mar 01
1
Asking for last +1 for render :parial => @something in namespaced controllers patch
Hello,
http://dev.rubyonrails.org/ticket/9742
If anyone is annoyed by that, please find a moment to review the
patch. It''s rather tiny and tested enough. It still applies cleanly
(r8962) as I write this.
Thanks,
Jacek Becela
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core"
2005 Dec 22
0
use helper methods in controller? (sanitize)
Hi,
I want to use the method sanitize() to clean up some user input before I
save it to the db. sanitize() is a helper method, so it is only usable
in templates, right?
So how can I use helper methods in the controller, or why should I not?
I could build a template like "<%=sanitize(input)-%>" and use
render_to_string, but that seems pretty hackish.
Or I could sanitize every