Displaying 20 results from an estimated 300 matches similar to: "Formatting data drawn from a DB"
2006 Apr 21
11
Phone Numbers in Rails/MySQL
Is there any easy way to make a fancy looking form to take phone
numbers. Something that looks like this:
[ ] - [ ] - [ ] ext: [ ]
Then when you submit it it''s combined into one string in the database.
Optimally it would auto-switch from field-to-field after you fill each
field.
Has anyone seen anything like this in Rails?
Thanks,
Adam
--
Posted via
2002 Jul 02
0
Newsletter & Rigatoni Salad Recipe
2006 Jul 11
17
[Best Practices] phone numbers??
I''ve seen phone numbers handled many different ways. Is there a recommended
Rails way to store, format and display phone numbers? I''d appreciate
comments from the community on this.
1. Is it better to store phone number as a 10-digit string? Then format it
as desired when displaying it?
2. or, is it better to store with formatting, ie. "(222) 111-2222" ?
3. Is
2006 Aug 09
7
function before_save
Hi everybody
I would like a function as the "before_save" method in the model. But it
must be the opposite. When I take out data from the database through the
model, I want to call a function before the data are available in the
controller.
Can anyone help me?
---- >>>> thx <<<< ----
--
Posted via http://www.ruby-forum.com/.
2008 Jul 26
4
simple_format, (long) urls, and wrapping
I''m using simple_format to format and display posted content from
users. This content sometimes has urls in it.
The problem I''m having is that if the urls are long enough to wrap,
they do, but the url gets split with a <br> tag. Then, if the user
clicks on the link, only the first, non-wrapped part of the link gets
posted to the browser... and that''s an invalid
2006 Apr 22
5
selenium plugin not working with rails 1.1
Hi,
I really like selenium, and I just tried the plugin created Jonas
Bengtsson. However I cannot get it to run on rails 1.1 and coundn''t find
anyone complaining about it?
Did anyone get it to run on rails 1.1.2?
Greets,
Abdur-Rahman
2012 Dec 24
4
Bad idea to add/remove associations in after_find
I have 2 distinct types of users (artists and curators) in my system and
they currently share all associations (eg has_one :portfolio).
However, a curator shouldn''t have a portfolio so I would like to only
add that association when required. Obviously I could just return nil
for that method, but it doesn''t feel right having that there in the
first place.
What''s the best
2008 May 29
4
ruby's simple_format method is not working for spaces.
Ruby''s simple_format method is not working for spaces. so how to add and
what to add in simple format method code so it also work for spaces?
--
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, send email to
2008 Jan 22
4
newlines in text_area
Hi @ all
I would like to enter a text with a text_area into the database. It runs
excellent. But when I want to show the entered text in the show view,
all newlines (paragraphs) are deleted and the text is only one block.
How can I save the returns (newlines) too?
Thanks for helping!!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received
2006 Mar 30
2
How do I format text before saving it?
I tried to use a before_save and use simple_format, it returns and
undefined method error. Can I even use these methods within a model? I
tried to use auto_link and it failed too. What am I doing wrong?
Furthermore, would it be recommended I format text before saving it to
the database? Advantages or disadvantages?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 04
2
simple_format and in_place_editor_field
Hi!
How can i do to force an in_place_editor_field to format the text with
simple_format while not editing?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060104/bbd141a2/attachment.html
2006 May 09
11
model filter?
Hi All,
Is there a way to filter / modify the output of a model class before
it''s returned to controller/view that''s calling it?
Example: I have a field phone_number which I always want to preformat
using the number_to_phone() helper....
Any help is appriciated.
Thanks!
--
Posted via http://www.ruby-forum.com/.
2009 Feb 24
2
Displaying line breaks & paragraphs using 'simple_format' ?
Hi there,
I need to:
1. STORE a text of the below format in a (MySQL) database (using a
''textarea''), and then
2. RETRIEVE & DISPLAY it in exactly the same format (meaning: keeping
all paragraphs/line breaks).
The intended text format looks like this:
***
Blah blahblah blah blah blahblah blah blah
blahblah blah blah blahblah blah, blah
blahblah. <- NEW
2007 Jan 16
2
Using view helpers in migrations?
I''m writing a bloggish/CMSish thing. I had been using simple_format,
but my users requested a rich editor, so I added TinyMCE.
Anyway, I was trying to migrate the existing content (since TinyMCE
assumes it''s reading HTML-formatted text), and realized that I
couldn''t call simple_format (or other helper methods) from Migrations.
Can someone enlighten me here?
2006 Feb 11
5
after_(read|find) callback?
I am pondering the possibility of encrypting/decrypting some fields
in a SQLite backend on-the-fly.
The point of the message is not security, I know that''s broken, but
whether there''s a technique that provides on-the-fly save/read
filters. Of course the solution would need to work transparently in
joins, so
user.posts.last.title
would do the right thing if title
2006 Jun 21
3
[PLUG] new plugin, acts_as_modified
Nothing special, just my first plugin. it came out of a request I saw on
the list from someone who wanted to be able to tell if a model''s attributes
had changed prior to being saved. Well, this plugin does just that (at
least I hope it does).
http://rubyforge.org/projects/actsasmodified/
Please see the README for details. Constructive comments and criticisms are
appreciated.
Chris
2007 Mar 04
4
Rails functional testing and Mocha
I''ve always wanted to be able to do stuff like this in my functional
tests
c = customers(:customer_1)
c.expects(:great_customer_service)
post :service_customer, :id => c.id
This of course fails because inside the rails action a different
instance of customer is used. Some of the time setting your
expectation/stubbing on Customer.any_instance works, but it''s not
2006 Apr 15
3
Dumb newbie question - text formatting?
I have a MySQL "text" element that I''m trying to display, but it''s not
formatting (i.e. it''s all one big paragraph). In the AWD depot example
it doesn''t look like they do anything special, but they get formatted
text. I''ve tried it with both:
<%= show.description %> - puts text, and formats according to any HTML
tags I typed in.
2006 Aug 14
3
New line char in a text area field on DISPLAY
I have a text_area to accept upto 1000 chars, which is stored as a blob
in mysql. When I try to display the saved data, I dont see the new line
characters - however I could see the newline characters in EDIT MODE. So
my newline char is lost during displaying. Any ideas how to fix it.
thanks
thila
--
Posted via http://www.ruby-forum.com/.
2006 Oct 08
1
Two-way eager loading?
My problem is that I have two classes where the eager loading isn''t
working as well as I would hope...
Here are my two classes:
class Daynote < ActiveRecord::Base
belongs_to :userplace
class Userplace < ActiveRecord::Base
has_many :daynote, :dependent => true
When I show my userplaces, I want to get the associated daynotes with
them, so I am doing:
@userplace =