[Rails] Re: Regular expression: How do I allow forward slashes?

2009-12-18 Thread ralu
On Dec 18, 11:01 pm, AlwaysCharging wrote: > In my app, I allow users to submit urls.  They (of course) need the > ability to submit urls with a forward slash, "/", but whats the > regular expression to allow them to do that? > > I currently use: > > validates_format_of :url, :with => /^[-\w\_.]

Re: [Rails] Regular expression: How do I allow forward slashes?

2009-12-18 Thread maryam kamali
inotwell cumpiuter &and lunguish engilish thanks On Sat, Dec 19, 2009 at 10:31 AM, AlwaysCharging wrote: > In my app, I allow users to submit urls. They (of course) need the > ability to submit urls with a forward slash, "/", but whats the > regular expression to allow them to do that? > > I cu

[Rails] Regular expression: How do I allow forward slashes?

2009-12-18 Thread AlwaysCharging
In my app, I allow users to submit urls. They (of course) need the ability to submit urls with a forward slash, "/", but whats the regular expression to allow them to do that? I currently use: validates_format_of :url, :with => /^[-\w\_.]+$/i to only allow alphanumerics, dashes, underscores, an

[Rails] Re: accepts_nested_attributes_for + paperclip + polymorphic + problem

2009-12-18 Thread andresgutgon
Thanks, it worked for me to :D On Dec 7, 1:41 pm, Antony Sastre wrote: > Hi Ab, > > The form view should read: > > <% form_for @office, :html => {:multipart => true} do |f| %> > > This is always the case when dealing with file uploads. > > On Dec 7, 9:05 am, Abhishek shukla wrote: > > > Hello Fr

[Rails] Re: single table relation, newbee question

2009-12-18 Thread adrianb
On Dec 18, 7:18 am, jeb wrote: > I am not sure if I shall use single table inheritance, or something > else. > > I have a model called horses, in that I have the columns mother_id and > father_id where I of course intend to store the id of that horses > mother and father. By that information alo

[Rails] TinyMCE v. FCKeditor v. others

2009-12-18 Thread Rilindo Foster
I got an idea to integrate a WYSIWYG editor (which I will implement tomorrow) and from what I can tell, there are two that are currently in used most widely. TinyMCE FCKeditor Any preference in terms of setup, ease of use and features? I was about to use TinyMCE, but FCKeditors appears to have

[Rails] Re: Understanding where certain 'inherited' methods come from in ActionController::Base

2009-12-18 Thread Manuca
On Dec 17, 6:21 pm, Yehuda Katz wrote: > Hope this helps. Thanks Yehuda that was of help. m. -- 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-t...@googlegroups.com. To unsubscribe from thi

[Rails] Re: ActionBuilding a new association in a form

2009-12-18 Thread Manuca
On Dec 18, 4:56 pm, byrnejb wrote: > Now, in my case both R and U must exist before they may be associated > and neither may be created in the same process that creates the > association row in C.  Further, the association in C contains data > unique to that association. Hi, I was about to post a

Re: [Rails] unknown attribute: commit

2009-12-18 Thread Rick DeNatale
On Fri, Dec 18, 2009 at 6:45 PM, salamander wrote: > Anyone experience this before? > > I have a very simple form, and when I try to submit the form I get an > "unknown attribute: commit" error. > > Here is the form: > > <% form_for @nominator do |f| %> >  <%= f.error_messages %> > >    <%= f.labe

Re: [Rails] unknown attribute: commit

2009-12-18 Thread Philip Hallstrom
On Dec 18, 2009, at 3:45 PM, salamander wrote: > Anyone experience this before? > > I have a very simple form, and when I try to submit the form I get an > "unknown attribute: commit" error. > > Here is the form: > > <% form_for @nominator do |f| %> > <%= f.error_messages %> > ><%= f.label :

Re: [Rails] Proper/Safe way to search across columns?

2009-12-18 Thread Philip Hallstrom
On Dec 18, 2009, at 3:58 PM, Rilindo Foster wrote: > Thanks to people on this list, I was able to implement a search > across columns (thank you guys!) However, I am not sure if I did it > the right way. > > What I did is that on the view page, I have implemented the search > as follows: >

[Rails] Proper/Safe way to search across columns?

2009-12-18 Thread Rilindo Foster
Thanks to people on this list, I was able to implement a search across columns (thank you guys!) However, I am not sure if I did it the right way. What I did is that on the view page, I have implemented the search as follows: <% form_tag books_path, :method => 'get' do %> <%= text_field_

[Rails] unknown attribute: commit

2009-12-18 Thread salamander
Anyone experience this before? I have a very simple form, and when I try to submit the form I get an "unknown attribute: commit" error. Here is the form: <% form_for @nominator do |f| %> <%= f.error_messages %> <%= f.label :first_name %> <%= f.text_field :first_name %> <%= f.label

[Rails] Iconv UTF-8 to ASCII EXTENDED

2009-12-18 Thread FF
Ruby 1.8.6 Rails 2.3.2 The DB is runnig with UTF-8 codification. I need to export some text field from the DB to TXT file for import with another app runnig under DOS (no comments please...). I am having problems exporting texts containing chars like á, ú or é. Here an example os the behaviour: #

[Rails] NoMethodError in Books#index

2009-12-18 Thread tesla
hi i have books_controller(action new index show create update..) by scaffolding and i add these lines to my program books_controller action def buy @book = Book.find(params[:id]) @book.user = current_user end routes.rb map.resources :books, :collection => { :buy => :get } ***

[Rails] Re: Protecting Ruby on Rails Application

2009-12-18 Thread Arania Jain
Hello, You may want to check out http://www.rubyencoder.com/ They offer a 7 day free trial too. Regards, Arania Jain On Dec 18, 7:27 am, Essam wrote: > Hello, > > In PHP I use ionCube (www.ioncube.com) to protect my intellectual > properties. What its equivalent that I can use for my Ruby on R

[Rails] Re: RFC: conflict_warnings plugin

2009-12-18 Thread Emery Finkelstein
I remember looking at optimistic locking before I started to write this thing. I dismissed it because optimistic locking was used for two requests that enter memory at about the same time. I had a need for that same behaviour that persists across controller requests. Which optimistic locking doesn'

[Rails] Routing error: Double slash in resources

2009-12-18 Thread Marqueti
Hi, I get a application running over: Rails 2.3.5, Application is set 2.1.0 at enviroment.rb Ruby: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.2.0] The Urls are generated right, but the resources like stylesheets, javascripts are generated with double slashes. ex: http://127.0.0.1:3000/

Re: [Rails] Re: A Describe Method / Pull list of Fields

2009-12-18 Thread rilindo foster
Terrific, guys. Thanks! On Fri, Dec 18, 2009 at 11:27 AM, mat wrote: > There are a number of activerecord methods that will probably get you > what you want.  Take a look at columns or inspect. > > http://api.rubyonrails.org/classes/ActiveRecord/Base.html > > M > > On Dec 17, 8:17 pm, Rilindo Fos

Re: [Rails] single table relation, newbee question

2009-12-18 Thread Colin Law
2009/12/17 jeb : > I am not sure if I shall use single table inheritance, or something > else. > > I have a model called horses, in that I have the columns mother_id and > father_id where I of course intend to store the id of that horses > mother and father. By that information alone I want to crea

Re: [Rails] Newbie problems with scaffolding

2009-12-18 Thread Colin Law
2009/12/18 adrian_m : > Hello all, > > I've started to write my first Rails application, using rails 2.3.5 > and some tutorials found on the net (for example Four Days on > Rails) .  I've just discovered that the scaffolding information found > in most (older) tutorials are completely unusable with

[Rails] Protecting Ruby on Rails Application

2009-12-18 Thread Essam
Hello, In PHP I use ionCube (www.ioncube.com) to protect my intellectual properties. What its equivalent that I can use for my Ruby on Rails applications? Thanks. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, se

[Rails] Re: A Describe Method / Pull list of Fields

2009-12-18 Thread mat
There are a number of activerecord methods that will probably get you what you want. Take a look at columns or inspect. http://api.rubyonrails.org/classes/ActiveRecord/Base.html M On Dec 17, 8:17 pm, Rilindo Foster wrote: > Is there a method that can either run a describe on the table or pull

[Rails] openssl

2009-12-18 Thread Ro
Ok, the question is: when I try to make a ruby script/server RoR says: that cannot load openssl (Runtime error) Then I have successfully installed openssl (0.9.8) on a RedHat (i686) but when I try to go in ruby/ext/openssl and make a ruby extconf.rb make make install He say thing

[Rails] Newbie problems with scaffolding

2009-12-18 Thread adrian_m
Hello all, I've started to write my first Rails application, using rails 2.3.5 and some tutorials found on the net (for example Four Days on Rails) . I've just discovered that the scaffolding information found in most (older) tutorials are completely unusable with recent rails versions . This is

[Rails] single table relation, newbee question

2009-12-18 Thread jeb
I am not sure if I shall use single table inheritance, or something else. I have a model called horses, in that I have the columns mother_id and father_id where I of course intend to store the id of that horses mother and father. By that information alone I want to create a relation in the horses

[Rails] ActionBuilding a new association in a form

2009-12-18 Thread byrnejb
I would like to use a single form to display multiple existing associations and to permit additions to those that already exist. In its simplest form a row in U has an association to a row R through a row in C. Now, in my case both R and U must exist before they may be associated and neither may

[Rails] Re: SQL query problem

2009-12-18 Thread Matt Jones
On Dec 18, 12:10 am, Ease Bus wrote: > Please help me with finding a SQL select statement for the following   > problems. > > I have two classes: Site and Link > > Table Link has two columns: linking_site_id, and linked_site_id > > I would like to find all the links in table Link where linking_s

[Rails] Re: RFC: conflict_warnings plugin

2009-12-18 Thread Matt Jones
The underlying model mechanism appears to have re-invented optimistic locking (by checking updated_at rather than lock_version), but the view code stuff looks like it might be useful... --Matt Jones On Dec 17, 8:21 am, Emery Finkelstein wrote: > Greetings, > > I was hoping to get some feedback o

Re: [Rails] Re: Passwords

2009-12-18 Thread Conrad Taylor
On Fri, Dec 18, 2009 at 8:47 AM, tispratik wrote: > Thanks for the inputs Norm and Denix. > > In addition to the comments of Norm and Denix, I would simply setup a staging server for developers to push code to and allow them to have ( SVN | CVS | GIT ) access only. Also, they would also push cod

[Rails] [ANN] Skyline CMS Release 3.0.8

2009-12-18 Thread Flurin Egger
Hi All, Just 10 days after 3.0.7 we're releasing 3.0.8 with support for SQLite3. In combination with our demo application, this makes trying out Skyline CMS a breeze. We also enabled Github issues for Skyline to track bugs and issues with Skyline CMS. Besides the SQLite3 support the most notable

[Rails] Re: Passwords

2009-12-18 Thread tispratik
Thanks for the inputs Norm and Denix. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@goog

Re: [Rails] svg in Rails

2009-12-18 Thread Hassan Schroeder
On Fri, Dec 18, 2009 at 1:16 AM, Prashant wrote: > I have a HTML file which calls svg file in embed tag. Opening this > HTML file w/o rails show proper content, but when we make this as part > of Rails App we get an error. -- Hassan Schroeder ---

Re: [Rails] EDI

2009-12-18 Thread bill walton
Hi Tom, On Wed, 2009-12-16 at 14:59 -0500, tom wrote: > Bill, are u more familiar with EDI? i mean the various protocols / > subsets etc? Not so much. There was a point in the past where I had to know / use some of that but not for a long time. And I hope I never have to go back ;-) Best regar

[Rails] Re: EDI

2009-12-18 Thread Bob
The XML stuff previously mentioned should do a good job at handling the mapping. Ruby has a pretty good http library which is the protocol I use for EDI transmissions. What I don't know is how well ruby is at doing PGP encryption / decryption. Not sure what your spec requires. On Dec 17, 10:32 

[Rails] Undefined Method error - help request

2009-12-18 Thread SMR
Good morning All - I am working on a time tracking application as a learning excercise and have run into an error neither I nor Google can remedy. When loading my view, I get an error: 'undefined method 'true_class_path' for # Workbench Controller code: def assign_worktrack(project_identifier)

[Rails] Re: SQL query problem

2009-12-18 Thread Clemens
plain SQL solution, although not really scalable, I guess... ;-) : SELECT * FROM `links` as l WHERE l.linking_site = 3 or (l.linked_site = 3 AND (select count(*) from links where linking_site=3 and linked_site=l.linking_site)=0) On 18 Dez., 06:10, Ease Bus wrote: > Please help me with find

[Rails] Re: A Describe Method / Pull list of Fields

2009-12-18 Thread Emery Finkelstein
There is also the ActiveRecord::Base method column_names. Which essentially returns the same thing as Book.column_names.collect (&:name) On Dec 18, 3:07 am, Kip Cole wrote: > Rilindo, the class method "columns" called on an ActiveRecord class is what > you want.  Let's say you have a table cal

[Rails] sorting/searching in active record by calculated fields

2009-12-18 Thread pankaj
What is the best way to do sorting/searching in active record by calculated fields. Regards, Pankaj -- 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-t...@googlegroups.com. To unsubscribe fr

[Rails] Re: svg in Rails

2009-12-18 Thread Prashant
No I saved it as html On Dec 18, 2:19 pm, INDRANIL MUKHERJEE wrote: > did u saved the html file as rhtml when using rails > > On Fri, Dec 18, 2009 at 2:46 PM, Prashant wrote: > > > > > I have a HTML file which calls svg file in embed tag. Opening this > > HTML file w/o rails show proper content,

Re: [Rails] svg in Rails

2009-12-18 Thread INDRANIL MUKHERJEE
did u saved the html file as rhtml when using rails On Fri, Dec 18, 2009 at 2:46 PM, Prashant wrote: > I have a HTML file which calls svg file in embed tag. Opening this > HTML file w/o rails show proper content, but when we make this as part > of Rails App we get an error. Is there any workaroun

[Rails] svg in Rails

2009-12-18 Thread Prashant
I have a HTML file which calls svg file in embed tag. Opening this HTML file w/o rails show proper content, but when we make this as part of Rails App we get an error. Is there any workaround to use svg in rails -- You received this message because you are subscribed to the Google Groups "Ruby o

[Rails] Re: Segmenting databases in environments

2009-12-18 Thread Clemens
you could make use of mysql replication for the user-table --> http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-do-table On 16 Dez., 23:27, mrmanishs wrote: > We have two environments, sandbox and production, each with it's own > main database. Howeve

[Rails] RE: A Describe Method / Pull list of Fields

2009-12-18 Thread Kip Cole
Rilindo, the class method "columns" called on an ActiveRecord class is what you want. Let's say you have a table called "books" with corresponding model Book. Then: Book.columns will return an array of column objects of the columns in the table. Not so useful for a select list. Book.column