Displaying 20 results from an estimated 10000 matches similar to: "Using action view helpers (strip_tags) in a rake task?"
2006 Aug 10
3
Want to use a view helper (TextHelper) in a model class
I have a model that deals with HTML and I want to use the
text_helper.sanitize method to strip the HTML of Javascript.
However, it doesn''t appear that I can get easy access to the text_helper
methods from within a model.
Anyone have any suggestions for how to do this?
In general, I think that there are some ActionView helpers which are
generic enough to want to use in a model class.
2009 Mar 05
0
Insert using Rake Task
Hi,
Anyone can help me, I run my source code using rake task. It seems no
error was trace, but when I look the table it doesn''t insert.I select
the data here MysqlDB.Tablename and update/insert here
SQLserverDB.TableName.
# Start Here
# rake mysqldata_select:sqldata_update
def clean_html(html)
new_html = strip_tags(html) # remove html tags
new_html = decode_entities(new_html) #
2012 Aug 10
0
Missing earlier versions work around for "XSS Vulnerability in strip_tags"
The rubyonrails-security announcement for CVE-2012-3465 "XSS
Vulnerability in strip_tags" mentions that a work around for earlier
versions should be attached, but there''s none, only patches for 3.0
series and up.
Is the work around available? If so, where can I get hold of it?
Thanks in advance,
Peter
--
Posted via http://www.ruby-forum.com/.
--
You received this message
2006 Jul 11
0
better way to include helpers into application controller/test_helper?
Right now, I have the following in my application controller - and a
simliar version is duplicated in test_helper. There must be a better
way to include common functionality like this that gets used across
layers? Maybe at the very least a way to include it at the class
level and instance level with one line?
# provide access to text helper at class level
def self.text_helper
2010 Feb 02
0
[Security] Loofah has an HTML injection / XSS vulnerability, please upgrade to 0.4.6
Synopsis
----------
Loofah::HTML::Document#text emits unencoded HTML entities prior to
0.4.6. This was originally by design, since the output of #text is
intended to be used in a non-HTML context (such as generation of
human-readable text documents).
However, Loofah::XssFoliate''s default behavior and
Loofah::Helpers#strip_tags
both use #text to strip tags out of the output, meaning that
2006 May 16
0
htmltools 1.09 doesn''t play nice with ActionPack strip_tags!
All,
I''ve discovered an incompatibility between HTMLTools 1.09 (a very handy
HTML parser) and ActionPack 1.12.1.
Basically, they both do some HTML parsing and they both create a module
named HTML::Tag, which causes confusion when said Tag object attempts to
be instantiated in the ActionPack context.
That said, now I get to choose which one''s namespace to fiddle with.
But a
2013 Jul 01
0
Rake task like "rake cache_digests:dependencies" for Rails 4?
The cache_digests gem has the "rake cache_digests:dependencies" task for
checking template dependencies.
Since Rails 4 includes this caching scheme by default, should it include a
similar rake task?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send
2006 Oct 22
0
[705] trunk/wxruby2/rake/rakedocs.rb: Add rake task to publish docs to wxruby website (Alex Fenton)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding:
2006 Mar 21
0
is "Task" a reserved class name in Edge Rails? (it clashes with Rake''s Task)
Ok, so I''ll bet that lots of people would naturally have a DB table called
"Tasks" and a model called Task, and this works fine in Rails 1.0. BUT,
using Edge Rails things turn strange when you start visiting your Task pages
because it thinks that you''re trying to use Rake (which also has a Task
class). Is there any way around this?
-Greg
Greg Edwards
CTO,
2013 Feb 28
0
Rake tasks db:test:prepare cannot be executed in the same task of db:reset or db:migrate
Hey all,
I''m trying to create a task that prepare the environment to start
programming.
To do so, I created a task like this *task :setup_env => [''db:reset'',
''db:migrate'', ''db:test:prepare'']* and observed that after execute *
rake setup_env*, it never execute db:test:prepare properly. In order to get
the schema cloned to test db,
2007 Dec 26
2
How to set environment when calling rake task inside another
This is what I have inside a rake task. In this rake task I need to call
another rake task called email:send_messages. However I need to pass the
RAILS_ENV as ''staging''.
Rake::Task["rake:email:send_messages"].invoke
I tried a lot of variations but none of them work.
Rake::Task["rake:email:send_messages"].invoke RAILS_ENV=staging
2007 Oct 12
0
Speccing a rake task
Greetings,
I''m writing a custom rake task, and I''d like to write an assosciated spec for it.
Does anyone have an example spec for a rake task?
I''ve seen some examples on the web that use these before blocks:
before(:each) do
@rake = Rake::Application.new
Rake.application = @rake
end
And use
@rake["db:user_migration"].invoke
To invoke the
2006 May 09
2
Disabling FOREIGN KEYs in a Rake task
Hi,
How could I disable my database FOREIGN KEYs in a Rake task?
Or, how could I call the execute() method in a Rake task?
I''m trying to perform something like:
task :delete_the_cippalippa => :environment do
require RAILS_ROOT+''/lib/marsian.rb''
# FIXME: execute() is undefined
execute "SET FOREIGN_KEY_CHECKS = 0"
Cippalippa.delete(-1)
2006 Apr 18
0
extend doc:app rake task to Include lib/*?
I''ve never really done much with rake and I''m trying to figure out how
to add some options to the doc:app task. For instance I''d like to
include documentation for files in the lib directory. I can''t seem to
figure out the proper way to do it short of changing the
lib/tasks/documentation.rake in the rails distribution. After poking
around in the rails tasks, I
2006 Aug 11
1
Absolute path to public/images in rake task?
Hi all
I''m trying to create a rake task for the first time, so please be a bit
patient with me. ;-)
I''m coding a photo gallery. Every photo gallery''s photos are in its own
folder, and after an update I''d like to be able to synchronize the photo
files with the database (because every photo has its own Photo class
object). I''ve got so far:
# File
2006 Jun 28
1
Is there a rake task to extract data from a database/table
I know I can get the schema by running
rake db_schema_dump
but, is there a way to ge the data from a table or a database into a format
that can be quickly converted to a migration. What I''m really trying to do
is synch my local development database (schema and data) with the db on my
hosting service.
--
Best Regards,
-Larry
"Work, work, work...there is no satisfactory
2005 Dec 26
0
Rake (default task) overwrites development database?
I changed the subject to be more appropriate. Any idea why the
development database would be effected?
On 12/26/05, Ryan Wood <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hey all. Hope you can help with this. I was running "rake" to run
> tests on my server we are setting up for production. I''m currently
> entering all my data into the dev
2008 May 26
1
Rake db task
Hello,
just wanted to know how to create a rake db task to populate data into
a database.
Thanks
Joel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group,
2008 Apr 08
2
Can you add an option to select the ruby interpreter for rake task?
Hi all,
My problem is that I''ve installed both ruby 1.8 (as ruby) and
ruby 1.9 (as ruby1.9) on my system. I use spec/rake/spectask for
my Rakefile. But the generated command is
ruby -I.. blabla
it should be "ruby1.9 -I... blabla", but after look at the code
of spectask.rb, I found this line:
==> cmd = "ruby "
rb_opts = ruby_opts.clone
2008 Feb 05
0
How do I override a method that's only invoked from a rake task
I want to override structure_dump in the MysqlAdapter class. (It
doesn''t dump some stuff I need for my implementation and I''m extending
it to do that.)
I know how to override methods in application code.
MysqlAdapter#structure_dump is called from the rake task
db:structure:dump, and I can''t figure out where to put the overriding
implementation so that it gets called