Re: [Rails] Subtract time

2012-08-29 Thread Colin Law
On 29 August 2012 07:48, keerthi wrote: > @colin here i found in console > >>> @bio = Biometric.find(36457) > => # 09:30:00", checkin_checkout: nil, forget: nil, reason: nil, entered_by: nil, > created_at: "2012-08-29 09:30:00", updated_at: "2012-08-29 09:30:00", > RealCheckIn: nil, MACHINENO: nil

Re: [Rails] Subtract time

2012-08-29 Thread Swati Verma
You can do (Time.now - Time.mktime(*ParseDate.parsedate((t.created_at).to_s))) On Wed, Aug 29, 2012 at 12:18 PM, keerthi wrote: > @colin here i found in console > > >> @bio = Biometric.find(36457) > => # 09:30:00", checkin_checkout: nil, forget: nil, reason: nil, entered_by: > nil, created_at: "

Re: [Rails] Subtract time

2012-08-29 Thread Swati Verma
You can do (Time.now - Time.mktime(*ParseDate.parsedate((t.created_at).to_s))) On Wednesday, 29 August 2012 13:20:29 UTC+5:30, Colin Law wrote: > > On 29 August 2012 07:48, keerthi > > wrote: > > @colin here i found in console > > > >>> @bio = Biometric.find(36457) > > => # > 09:30:00", che

[Rails] Re: How to open the pdf from the server via database?

2012-08-29 Thread INDIAN RAILS DEVELOPER
What all things you want to learn,i can teach you.email me on paritoshparitos...@gmail.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 rubyonrails-talk@googlegroups.com. To unsubscribe from this g

Re: [Rails] Re: How to open the pdf from the server via database?

2012-08-29 Thread Loganathan Sellapa
+1 regards, Loganathan Mob: +91 7760780741 | +91 9944414388 Skype: loganathan.sellappa ViewMe On Wed, Aug 29, 2012 at 2:57 PM, INDIAN RAILS DEVELOPER < paritoshparitos...@gmail.com> wrote: > What all things you want to learn,i can teach you.email me on > paritosh

[Rails] Re: MySQL Installation Issues

2012-08-29 Thread Simon R.
This is an old thread, but if you google the error message, it appears first in the list of results, so it's worth writing a summary. The root of the problem is that to install the mysql gem you need to compile some native code. ("Native code" is software written in a language such as C or C++

Re: [Rails] Subtract time

2012-08-29 Thread keerthi
@swathi thanks for your reply but, i did not get ur trying to say. what is that Time.mktime and y u want o convert it to string On Wed, Aug 29, 2012 at 2:36 PM, Swati Verma wrote: > You can do > > (Time.now - Time.mktime(*ParseDate.parsedate((t.created_at).to_s))) > > > On Wed, Aug 29, 2012 at 12

Re: [Rails] Subtract time

2012-08-29 Thread keerthi
@swathi thanks i got what i need Cheers On Wed, Aug 29, 2012 at 2:36 PM, Swati Verma wrote: > You can do > > (Time.now - Time.mktime(*ParseDate.parsedate((t.created_at).to_s))) > > > On Wed, Aug 29, 2012 at 12:18 PM, keerthi wrote: > >> @colin here i found in console >> >> >> @bio = Biometric.fi

Re: [Rails] Subtract time

2012-08-29 Thread keerthi
i got the answer what i am expecting but can u explain me (Time.now - Time.mktime(*ParseDate.parsedate((t.created_at).to_s))) what exactly this line does" Time.mktime(*ParseDate.parsedate((t.created_at).to_s)) " On Wed, Aug 29, 2012 at 2:36 PM, Swati Verma wrote: > You can do > > (Time.now - T

Re: [Rails] Subtract time

2012-08-29 Thread Colin Law
On 29 August 2012 10:06, Swati Verma wrote: > You can do > > (Time.now - Time.mktime(*ParseDate.parsedate((t.created_at).to_s))) But why would you do that? Colin > > > On Wed, Aug 29, 2012 at 12:18 PM, keerthi > wrote: >> >> @colin here i found in console >> >> >> @bio = Biometric.find(36457)

[Rails] Efficient way of using multple Database

2012-08-29 Thread Karthikeyan A k
Is there a efficient way of using multiple databases in a Rails application. I saw DB Charmer but, it did not work with 3.2.8 and even in Rails 3.2.3 it gave problems. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby o

Re: [Rails] Efficient way of using multple Database

2012-08-29 Thread Colin Law
On 29 August 2012 12:31, Karthikeyan A k wrote: > Is there a efficient way of using multiple databases in a Rails > application. I saw DB Charmer but, it did not work with 3.2.8 and even > in Rails 3.2.3 it gave problems. Is using establish_connection inefficient? Colin -- You received this me

[Rails] Re: Re: Re: A Ruby Book (free to use)

2012-08-29 Thread Karthikeyan A k
Well I can't dig it if I am dead, hence doing it now. :-)) selva4...@gmail.com wrote in post #1073635: > On Tue, Aug 28, 2012 at 10:09 PM, Karthikeyan A k > wrote: >> Client?! Common, is Mac DRM free and Windows a free OS? This book is >> under GFDL, if you don't like it, write your own by rippin

[Rails] Re: Efficient way of using multple Database

2012-08-29 Thread Karthikeyan A k
Nope, what I am thinking is we need to migrate, the two databases need different set of tables. I am having a hard time. -- 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, s

Re: [Rails] Re: Efficient way of using multple Database

2012-08-29 Thread Colin Law
On 29 August 2012 13:54, Karthikeyan A k wrote: > Nope, what I am thinking is we need to migrate, the two databases need > different set of tables. I am having a hard time. Ah, ok, a subject line and posting that asked for the best way to handle migration of multiple databases might have been mor

Re: [Rails] Re: Re: Re: A Ruby Book (free to use)

2012-08-29 Thread selva4...@gmail.com
All the best :) On Wed, Aug 29, 2012 at 5:07 PM, Karthikeyan A k wrote: > Well I can't dig it if I am dead, hence doing it now. :-)) > > selva4...@gmail.com wrote in post #1073635: >> On Tue, Aug 28, 2012 at 10:09 PM, Karthikeyan A k >> wrote: >>> Client?! Common, is Mac DRM free and Windows a f

[Rails] Paginate an array

2012-08-29 Thread Sundar Ind
My controller code is as follows, def index end def show if params[:cat_id] # cat_id is fetched from DB(a table with two columns id and name) #mapped as cat_id in routes file @articles = Article.find_all_by_name(params[:cat_id].gsub(/\-/, ' ')) render :action => :in

[Rails] Re: Re: Re: Re: rail s exiting

2012-08-29 Thread Tak G.
Colin Law wrote in post #1073724: > On 28 August 2012 22:36, Tak G. wrote: but the error is pretty much this: >> have changed anything? > Are you asking whether changing the mother board could have changed > the text in some of your files on disk? > > More importantly you have not said whethe

[Rails] Re: Efficient way of using multple Database

2012-08-29 Thread Karthikeyan A k
There is a gem called DB charmer, but does not work :-( -- 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 rubyonrails-talk@googlegroups.com. To unsubscribe fro

Re: [Rails] Re: Re: Re: Re: rail s exiting

2012-08-29 Thread Colin Law
On 29 August 2012 14:08, Tak G. wrote: > Colin Law wrote in post #1073724: >> On 28 August 2012 22:36, Tak G. wrote: > but the error is pretty much this: >>> have changed anything? >> Are you asking whether changing the mother board could have changed >> the text in some of your files on disk

[Rails] Re: Re: Re: Re: Re: rail s exiting

2012-08-29 Thread Tak G.
Colin Law wrote in post #1073781: > On 29 August 2012 14:08, Tak G. wrote: >>> I assume you are using a Version Control System such as git. If not >>> then you should be. Then you can look back through the history to >>> find when changes were made. >>> >>> Colin >> >> Well honestly, it was work

Re: [Rails] Re: How to open the pdf from the server via database?

2012-08-29 Thread harika
+1 On Wed, Aug 29, 2012 at 2:59 PM, Loganathan Sellapa wrote: > +1 > > regards, > Loganathan > Mob: +91 7760780741 | +91 9944414388 > Skype: loganathan.sellappa > ViewMe > > > On Wed, Aug 29, 2012 at 2:57 PM, INDIAN RAILS DEVELOPER < > paritoshparitos...@gmail.c

[Rails] Re: A Ruby Book (free to use)

2012-08-29 Thread Anton Cherepanov
There is not enough space in 29 page Fine, if 1 is not equal to 2 to a computer when we type it, it must putout true, so type it in your Word - putout :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Tal

Re: [Rails] Re: Re: Re: Re: Re: rail s exiting

2012-08-29 Thread Colin Law
On 29 August 2012 14:37, Tak G. wrote: > Colin Law wrote in post #1073781: >> On 29 August 2012 14:08, Tak G. wrote: I assume you are using a Version Control System such as git. If not then you should be. Then you can look back through the history to find when changes were made.

Re: [Rails] index.html in rails-app/public

2012-08-29 Thread Walter Lee Davis
On Aug 27, 2012, at 1:54 AM, uma mahesh varma Seeram wrote: > I hope its not pointing to your rails application folder and its pointing to > some other folder in server and there by you are getting the default page. > > > Thank You, > Uma Mahesh. > Also, check if Apache or Nginx is set to pr

Re: [Rails] index.html in rails-app/public

2012-08-29 Thread Mandeep Kaur
On Wed, Aug 29, 2012 at 7:49 PM, Walter Lee Davis wrote: > > On Aug 27, 2012, at 1:54 AM, uma mahesh varma Seeram wrote: > > > Also, check if Apache or Nginx is set to provide a default index in folders > that don't contain one. mod_autoindex or similar... I am not getting this. Means i have to

Re: [Rails] index.html in rails-app/public

2012-08-29 Thread Walter Lee Davis
On Aug 29, 2012, at 10:33 AM, Mandeep Kaur wrote: > On Wed, Aug 29, 2012 at 7:49 PM, Walter Lee Davis wrote: >> >> On Aug 27, 2012, at 1:54 AM, uma mahesh varma Seeram wrote: >> > >> >> Also, check if Apache or Nginx is set to provide a default index in folders >> that don't contain one.

Re: [Rails] index.html in rails-app/public

2012-08-29 Thread Mandeep Kaur
On Wed, Aug 29, 2012 at 8:14 PM, Walter Lee Davis wrote: > > > On Aug 29, 2012, at 10:33 AM, Mandeep Kaur wrote: > >> I am not getting this. Means i have to remove this apache setting that >> automatically create default index page? >> > > If you're using Apache and Passenger, try adding this lin

[Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Walter Lee Davis
I have a model that includes a :current boolean. The idea is that there are many home pages that the admin is working on at any given time, but only one is current at a time. At the moment, I have enforced this with the following: before_save :toggle_current def toggle_current if current?

Re: [Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Michael Pavling
On 29 August 2012 16:13, Walter Lee Davis wrote: > I have a model that includes a :current boolean. The idea is that there are > many home pages that the admin is working on at any given time, but only one > is current at a time. At the moment, I have enforced this with the following: > > before

Re: [Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Walter Lee Davis
NICE! Arel collapsed the getting and setting to a single query: UPDATE "homes" SET "current" = 'f' WHERE (current = 't' & id != 3). On Aug 29, 2012, at 11:21 AM, Michael Pavling wrote: > On 29 August 2012 16:13, Walter Lee Davis wrote: >> I have a model that includes a :current boolean. The idea

Re: [Rails] Re: How to open the pdf from the server via database?

2012-08-29 Thread INDIAN RAILS DEVELOPER
Thanks for plus-ing :-) -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com.

Re: [Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Colin Law
On 29 August 2012 16:13, Walter Lee Davis wrote: > I have a model that includes a :current boolean. The idea is that there are > many home pages that the admin is working on at any given time, but only one > is current at a time. At the moment, I have enforced this with the following: I think y

[Rails] Re: How to open the pdf from the server via database?

2012-08-29 Thread Vinay Sri
Here is the Task... The EPC’s(PDF's) themselves are not stored in the database, this is because each client can have hundreds of EPCs and we don’t want these to increase the size of the database, instead we save the EPC’s on the server and link to them in the database. To get the path of the E

Re: [Rails] Re: How to open the pdf from the server via database?

2012-08-29 Thread Сергей Грибовский
Hello, I can help you with your task for three 'coz it simple. I want to practise in English so I think it can be useful for me too. Skype:embeddedcoder. 29.08.2012 21:02 пользователь "Vinay Sri" написал: -- You received this message because you are subscribed to the Google Groups "Ruby on Rail

Re: [Rails] index.html in rails-app/public

2012-08-29 Thread Mandeep Kaur
On Wed, Aug 29, 2012 at 8:16 PM, Mandeep Kaur wrote: > On Wed, Aug 29, 2012 at 8:14 PM, Walter Lee Davis wrote: >> >> If you're using Apache and Passenger, try adding this line inside the >> block in the relevant httpd.conf for this application: >> >> Options -Indexes >> >> Restart Apache and

[Rails] Re: Where to store functions

2012-08-29 Thread Dave Castellano
They are all very different, although all return a similar hash of arguments. Here is an example... def vergence_v u = (rand(2..6)).round(2) u_vergence =((1/(u*0.01)).round(2)) p = rand((u_vergence + 0.1) ..(u_vergence + 0.7)).round(2) v_vergence = (p - u_vergence).round(2) v = (1/v_ver

Re: [Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Walter Lee Davis
On Aug 29, 2012, at 12:04 PM, Colin Law wrote: > On 29 August 2012 16:13, Walter Lee Davis wrote: >> I have a model that includes a :current boolean. The idea is that there are >> many home pages that the admin is working on at any given time, but only one >> is current at a time. At the momen

Re: [Rails] Ruby problem solving Skills

2012-08-29 Thread Dave Aronson
On Wed, Aug 29, 2012 at 12:53 AM, thil wrote: > Is there any interesting sites is available for problems solving in Ruby > like Ruby-Monk. Check out Ruby Koans, at http://rubykoans.com/. -Dave -- Dave Aronson, Available Secret-Cleared Ruby/Rails Freelancer (VA/DC/Remote); see www.DaveAronson.

Re: [Rails] Help getting started: Newbie: Windows and Rails

2012-08-29 Thread INDIAN RAILS DEVELOPER
It seems like you are looking for editor,honestly speaking vim with rails and snipmate plugin is great. You may never look to some other editor. Only some initial learning curve is required . After then you will fly like superman and you feel proud to being so productive . I saw many job posit

[Rails] Re: Re: Re: Re: Re: Re: rail s exiting

2012-08-29 Thread Tak G.
FINALLY got it to work, looks like i missed one of the words. thank you so much for help. -- 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 rubyonrails-talk@

[Rails] Carrierwave Direct and additional form elements

2012-08-29 Thread Walter Lee Davis
I just switched a project from Dragonfly to Carrierwave, specifically to see if I could take advantage of Carrierwave Direct, which uploads large files directly to S3 or another cloud storage. I was able to make a form containing a single file field that would upload to S3. What I could not wo

Re: [Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Colin Law
On 29 August 2012 18:44, Walter Lee Davis wrote: > > On Aug 29, 2012, at 12:04 PM, Colin Law wrote: > >> On 29 August 2012 16:13, Walter Lee Davis wrote: >>> I have a model that includes a :current boolean. The idea is that there are >>> many home pages that the admin is working on at any given

Re: [Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Walter Lee Davis
On Aug 29, 2012, at 3:56 PM, Colin Law wrote: > On 29 August 2012 18:44, Walter Lee Davis wrote: >> >> On Aug 29, 2012, at 12:04 PM, Colin Law wrote: >> >>> On 29 August 2012 16:13, Walter Lee Davis wrote: I have a model that includes a :current boolean. The idea is that there are

Re: [Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Colin Law
On 29 August 2012 21:17, Walter Lee Davis wrote: > > On Aug 29, 2012, at 3:56 PM, Colin Law wrote: > >> On 29 August 2012 18:44, Walter Lee Davis wrote: >>> >>> On Aug 29, 2012, at 12:04 PM, Colin Law wrote: >>> On 29 August 2012 16:13, Walter Lee Davis wrote: > I have a model that incl

[Rails] custom js in rails project

2012-08-29 Thread Axel Aguilar
Hello, I have a rails project with one controller and one action, as simple as posible. And I'm trying to put some custom css and js to my own index.html.erb (not public/index.html.erb), I inluded this on the layout file: layout file: Volei <%= stylesheet_link_tag"application", :media

Re: [Rails] custom js in rails project

2012-08-29 Thread Sergey Gribovski
On 30.08.2012 00:44, Axel Aguilar wrote: Hello, I have a rails project with one controller and one action, as simple as posible. And I'm trying to put some custom css and js to my own index.html.erb (not public/index.html.erb), I inluded this on the layout file: layout file: Volei <%=

[Rails] Re: custom js in rails project

2012-08-29 Thread Axel Aguilar
thanks for answer (so fast!) now I have this in the layout file: <%= stylesheet_link_tag'application', :media => "all" %> <%= javascript_include_tag'application', :media => "all" %> <%= csrf_meta_tags %> also tryied: <%= stylesheet_link_tag'application', :media => "all" %>

[Rails] rail webrick error

2012-08-29 Thread Khan
Hi all i am trying to start my app and i got this error how to solve it => Booting WEBrick => Rails 2.3.8 application starting on http://0.0.0.0:3000 /usr/local/lib/site_ruby/1.8/rubygems.rb:233:in `activate': can't activate activesupport (= 2.3.14, runtime) for [], already activated activesupp

[Rails] How to access rails variable in assest pipelin

2012-08-29 Thread news.anand11
Hi, I am using devise for my user management. I am using angular js for my UI. I have folder structure like this for html: app/assets/partials/ I have added index.html.erb file over it. Now when I am going to access like this: <%= current_user %> I am getting error like: NameError (undefined

Re: [Rails] rail webrick error

2012-08-29 Thread keerthi
my gem list actionmailer (2.3.8) actionpack (2.3.8) activerecord (2.3.14, 2.3.8) activeresource (2.3.8) activesupport (2.3.14, 2.3.8) declarative_authorization (0.5.5) mysql (2.8.1) prawn (0.6.3) prawn-core (0.6.3) prawn-format (0.2.3) prawn-layout (0.3.2) prawn-security (0.1.1) rack (1.1.3) rails

Re: [Rails] rail webrick error

2012-08-29 Thread saikiran mothe
Hi , Already in your machine 2.3.8 rails version installed,you want to run 2.3.14 rails application. 1.You have to uninstall rails 2.3.8 and install rails 2.3.14 version gem install rails -v=2.3.14 (Or) 2.Install RVM https://rvm.io/rvm/install/ Cheers, Sai On Thu, Aug 30, 2012 at 1

Re: [Rails] rail webrick error

2012-08-29 Thread sameena Khan
Thanks for your reply ive install rails 2.3.14 also and i get the same error actionmailer (2.3.14, 2.3.8) actionpack (2.3.14, 2.3.8) activerecord (2.3.14, 2.3.8) activeresource (2.3.14, 2.3.8) activesupport (2.3.14, 2.3.8) declarative_authorization (0.5.5) mysql (2.8.1) prawn (0.6.3) prawn-core (0.

Re: [Rails] rail webrick error

2012-08-29 Thread saikiran mothe
gem uninstall rails -v=2.3.8 try to run this On Thu, Aug 30, 2012 at 12:18 PM, sameena Khan wrote: > Thanks for your reply ive install rails 2.3.14 also and i get the same > error > actionmailer (2.3.14, 2.3.8) > actionpack (2.3.14, 2.3.8) > activerecord (2.3.14, 2.3.8) > activeresource (2.3.14