similar to: Strip & Sanitize BEFORE saving data

Displaying 20 results from an estimated 5000 matches similar to: "Strip & Sanitize BEFORE saving data"

2007 Nov 16
4
Newb - variable returns # sign?
Hi Gurus- I want to return the variety from the species table based on the active record link to inventory table class Species < ActiveRecord::Base has_many :inventories end class Inventory < ActiveRecord::Base belongs_to :species (this is the singular and the plural, so that''s OK) end My inventory_controller looks like: def show @inventory =
2007 Nov 23
2
Capture IP Address to Sessions
What I''d like to do: Capture the IP addresses of the folks visiting a web site in the Sessions table. What needs to be in place (code, model, controller, etc.), where does it need to go (application controller?), how best to set up the Sessions table? Appreciate a noob-friendly outline of what needs to be done. Thanks. --~--~---------~--~----~------------~-------~--~----~ You
2007 Nov 16
3
Route Information
Is there a method to return a hash of the route configuration based on a path? For example: magic_method(''/my_controller/my_action/my_id'') => {:controller => ''my_controller'', :action => ''my_action'', :id => ''my_id''} Thanks! Tom --~--~---------~--~----~------------~-------~--~----~ You received this message
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
2007 Nov 21
1
iText, Rails, and OS X
I have the need to take existing PDFs and populate them with data entered via HTML forms. Data saved to database, entered in to PDF file, PDF file with data archived, and then distributed va email and/ or download. The languuage I previous did all my web work in, Lasso, had this stuff built in, but it appears not to be so with Ruby or Rails. The latest info I can find on this is a year
2007 Nov 14
6
a few add_index questions..
on previous apps i hadn''t really worried much about adding foreign key indexes on my tables just because they''ve been fairly small and i didn''t really think i needed them. well, i''m working on something now that has the potential to have a lot more data, and a lot more foreign keys. so i have 3 tables... users, projects, and tasks.. should i be using add_index
2006 May 30
7
Stripping HTML tags from a string
Hello, Is there a common way of stripping html tags from a string? Right now I''m just calling gsub!(/<.*?>/, ''''), but with a background in PHP and always having used its strip_tags() method, I wonder if the Rails community has standardized this fairly common task with something a bit less simpleminded than my quick fix. Thanks! Zack -------------- next part
2007 Nov 27
2
rendering this to the html page
hi guys, i have develop some coding like login forms and registration forms in normal ROR way. they are working 100% ok as i want. bt not i have created the html interface to my page and find dificult to add the ROR components that i have created to the newly design web interface. For a example. in the in my HTML file i have a allocate separate area(in the top right hand corner of the page.)
2007 Dec 17
2
Many domain - one rails application
If I have many domains and one rails application, how can I redirect to conrollers by domain? Ex. "domain.com" go to controller "/com", "domain.net" go to controller "/net" and "other.org" go to "/other" -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you
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.
2006 May 15
1
Simple: How to use TextHelper in a controller
I''m having trouble succesfully getting access to the ActionView::Helpers::TextHelper.strip_tags method from one of my controllers. If I try to call it directly using ActionView::Helpers::TextHelper.strip_tags I get undefined method `strip_tags'' for ActionView::Helpers::TextHelper:Module What is the preferred way to make ActionView helpers available to a descendant of
2006 May 03
1
Ruby based HTML - to - text converter?
All, I am interested in trying to generate a text version of an HTML document. Does any one know of any modules that may be of use to me? A cursory search has not yielded any results. Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2013 Mar 27
1
remove all html tag before validation
hi, is there a clean way to remove all html tag of all attributes before validation I found acts_as_sanitized that seemed to be perfect, but for rails 2 :-s thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to
2007 Oct 16
2
Where override model attribute names?
OK, so I get that ActiveRecord determines model attributes through reflection of the table schema. Handy for many cases, but not mine. I need to override that and provide my own mapping of attribute names to column names to use the mapped names throughout the application code. I''ve been poking around looking for where in AR''s hierarchy I can can inject this mapping, but
2006 Feb 27
12
RedCloth
Is this the prefered method to implement RedCloth in your views. I''m trying to display user input that will sometimes have code references in it. This strips out all tags. I would like for the tags to be displayed but not read as html. Thanks in advance! <%= RedCloth.new(strip_tags(comment.comment),[:filter_html]).to_html %> charlie bowman recentrambles.com -- Posted via
2008 Apr 13
3
Can't get simple link_to_remote to work
AFAICT, this is all I need to do to get a simple example working: the <head> should have this: <%= javascript_include_tag :defaults %> My test page view should have a div with an id and the ERB like this: <%= link_to_remote ''Click Me'', :url => {:action => ''show_time'', :update => ''time_box''} %>
2007 Jan 04
2
remove html tags from string in controller, how?
Been searching for a function that can do this, but have onl found a helper function. is there a way to strip all html tags of a string in a controller? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,
2006 Aug 15
20
Talking to Java APIs
I''m trying to figure out how Ruby in general, and/or anything extra Rails may have, can talk to Java APIs of third party server apps. After quite a few search attempts net-wide and on ruby forums, and with "Programming Ruby" in hand, I''m coming up with zilch. Either I''m not finding it, or I''m not recognizing it. I''m assuming there has
2008 Feb 12
4
Syntax of session's updated_at field ?
What''s the syntax to acquire the updated_at value of a session stored in a db? session.updated_at doesn''t work. can''t find any docs on this. -- gw --~--~---------~--~----~------------~-------~--~----~ 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
2008 Jun 13
3
Alternative to storing ActiveRecord object in session
I''m writing a wizard-like module in my application where, in a series of steps, the user builds upon an ActiveRecord object, and in the end, saves the AR object into the database. The ActiveRecord object is fairly complex, with a has_many association that could potentially get large, so I don''t want to store it directly in the session. In fact, having done so already caused a