Re: [Rails] Search for a word in a file before uploading

2012-11-19 Thread Akvarel
The check is performed during the upload. If the filename exists already in the database it will not be uploaded twice. Cannot I use this during uploading time to check the content of the file? Am Montag, 19. November 2012 01:04:56 UTC+1 schrieb Scott Ribe: On Nov 18, 2012, at 2:15 PM,

Re: [Rails] Search for a word in a file before uploading

2012-11-19 Thread Colin Law
On 19 November 2012 09:14, Akvarel kate.kokatju...@gmail.com wrote: The check is performed during the upload. If the filename exists already in the database it will not be uploaded twice. Cannot I use this during uploading time to check the content of the file? The upload operation is the act

[Rails] Forcing a reload for all user sessions

2012-11-19 Thread David M
I'm storing some user info in session (like the name, using cookies), in Ruby on Rails 3.2 - Let's suppose the user opens the site in two different browsers, and logs in. - He changes his name in one browser, and switches to the other browser and refreshes the page. - The

[Rails] Please Help...

2012-11-19 Thread Lanpen
I have a special request... I have a boyfriend who is a computer programmer. He is currently studying Ruby and I want to give his a gift that would be very meaningful to him. I wanted have a code that I could put in a frame in Ruby for the following: I can do all things through Christ who

Re: [Rails] rake test:units error because not null constraint.

2012-11-19 Thread Mauro
On 18 November 2012 21:24, Colin Law clan...@googlemail.com wrote: On 18 November 2012 19:42, Mauro mrsan...@gmail.com wrote: Hello. I have this unit test: test User validations do user = User.new assert user.invalid? assert user.errors[:uid].any? assert user.errors[:name].any?

Re: [Rails] Forcing a reload for all user sessions

2012-11-19 Thread Jordon Bedwell
On Mon, Nov 19, 2012 at 4:53 AM, David M idav...@gmail.com wrote: I'm storing some user info in session (like the name, using cookies), in Ruby on Rails 3.2 Let's suppose the user opens the site in two different browsers, and logs He changes his name in one browser, and switches to the other

[Rails] how to open a pop-up page in rails 3 and load data from database

2012-11-19 Thread Manish Nautiyal
I am using ruby-on-rails + psql I have list of pages. On some page click I have to open page in pop-up. How I'll load data in that pop-up for specific page. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Configuring proper sequence of Rack middlewares ...

2012-11-19 Thread Kedar Mhaswade
The best way to visualize the process here is to imagine the request comes in at the *top* of the middleware stack (AD::Static here) and is passed down to successive middlewares until it generates a response. The response then flows back *up* the stack until it gets to the top and is

[Rails] Rails 3.2 Logger

2012-11-19 Thread Erwin
I read the Rails doc about Tagged logger, it seems great , but I am missing some stuff : - where should I define the Logger class : Logger = ActiveSupport::TaggedLogging.new( File.join(Rails.root, log, new_logger_#{Rails.env}.log) - is it possible to define multiple Logger classes to

Re: [Rails] how to open a pop-up page in rails 3 and load data from database

2012-11-19 Thread Colin Law
On 19 November 2012 12:40, Manish Nautiyal li...@ruby-forum.com wrote: I am using ruby-on-rails + psql I have list of pages. On some page click I have to open page in pop-up. How I'll load data in that pop-up for specific page. Are you opening it using javascript, without contacting the

Re: [Rails] Drop down with model info

2012-11-19 Thread Walter Lee Davis
On Nov 19, 2012, at 2:28 AM, Jim Ruther Nill wrote: On Mon, Nov 19, 2012 at 2:56 PM, Robert Negronida li...@ruby-forum.com wrote: I have this code: %= f.select :name, [@m.each do |n| [ n.first_name , n.first_name ] end], :class = 'gam' % #each returns @m,

Re: [Rails] Drop down with model info

2012-11-19 Thread Jim Ruther Nill
On Mon, Nov 19, 2012 at 10:12 PM, Walter Lee Davis wa...@wdstudio.comwrote: On Nov 19, 2012, at 2:28 AM, Jim Ruther Nill wrote: On Mon, Nov 19, 2012 at 2:56 PM, Robert Negronida li...@ruby-forum.com wrote: I have this code: %= f.select :name, [@m.each do |n| [

[Rails] Ajax

2012-11-19 Thread Werner
On my edit page I can update values using ajax. In my edit action I also have something like: Model.where(model_id: id).sum(attribute) As the edit action is not executed anymore, I dont get a proper result after I add some new value, have to reload the page. How is the best way to actualize

Re: [Rails] Ajax

2012-11-19 Thread Jim Ruther Nill
On Mon, Nov 19, 2012 at 10:25 PM, Werner webagentur.la...@googlemail.comwrote: On my edit page I can update values using ajax. In my edit action I also have something like: Model.where(model_id: id).sum(attribute) As the edit action is not executed anymore, I dont get a proper result after

[Rails] Re: Drop down with model info

2012-11-19 Thread Werner
Something like that? %= f.select :city_id, @cities.map { |city| [city.name, city.id] } % Am Montag, 19. November 2012 07:57:39 UTC+1 schrieb Ruby-Forum.com User: I have this code: %= f.select :name, [@m.each do |n| [ n.first_name , n.first_name ] end], :class =

Re: [Rails] Search for a word in a file before uploading

2012-11-19 Thread Scott Ribe
On Nov 18, 2012, at 11:07 PM, Jekaterina Kokatjuhha wrote: It performed during upload because if there is the same filename is the database , the file will not be uploaded, That does not mean the file was not sent to the server. I phrased my question poorly, so here it is again, hopefully

[Rails] Re: Rails 3.2 Logger

2012-11-19 Thread Erwin
I can use the standard buffer class : MyBufferedLogger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/my_buffered.log')) MyBufferedLogger.info Hello World! # = OK but I cannot do it using the TaggedLogging buffer class MyTaggedLogger =

[Rails] Re: Rails 3.2 Logger

2012-11-19 Thread Erwin
[SOLVED] in doc : TaggedLogging is a wrapper ... so MyTaggedLogger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/my_tagged.log')) MyTaggedLogger = ActiveSupport::TaggedLogging.new(MyTaggedLogger) and MyTaggedLogger.tagged(BCX) { MyTaggedLogger.info Hello World! } # OK Le

[Rails] Alter sequence postgresql + rails

2012-11-19 Thread Guilherme Rodrigues
Hello. I would like to rename any sequence in my database, because I rename table, but yours sequence I don't know rename. Have rename with one migration? For example: rename_sequence :conta_id_seq, :account_id_seq?? Thank you. -- You received this message because you are subscribed to the

Re: [Rails] Alter sequence postgresql + rails

2012-11-19 Thread Colin Law
On 19 November 2012 16:36, Guilherme Rodrigues lopesg...@gmail.com wrote: Hello. I would like to rename any sequence in my database, because I rename table, but yours sequence I don't know rename. Have rename with one migration? For example: rename_sequence :conta_id_seq, :account_id_seq?? If

[Rails] Multiple models and views in 'transactions'

2012-11-19 Thread mongeta 99
Hi, I'm not surely if I'm going to be able to explain well ... We have a Rails 3.2 with backend PostgreSQL. We have 5 models that are nested/related between them, and all must be created/updated/destroyed in block, like a transaction. Those models are created using very complex views and some

Re: [Rails] Multiple models and views in 'transactions'

2012-11-19 Thread Colin Law
On 19 November 2012 17:23, mongeta 99 li...@ruby-forum.com wrote: Hi, I'm not surely if I'm going to be able to explain well ... We have a Rails 3.2 with backend PostgreSQL. We have 5 models that are nested/related between them, and all must be created/updated/destroyed in block, like a

[Rails] Re: Multiple models and views in 'transactions'

2012-11-19 Thread mongeta 99
Colin Law wrote in post #1085205: On 19 November 2012 17:23, mongeta 99 li...@ruby-forum.com wrote: is for a very complex ERP. We don't want to store 'invalid data' in the real tables, like using some attribute like 'pending' or 'modifying'. One solution that I'm experiment with it, and it

[Rails] Struggling at Rails beginner help

2012-11-19 Thread Joz Private
So I've just dipped into Rails and I'm completely lost ... I have a very simple website. There are 2 layouts, application and welcome. The route begins at the welcome layout. The main controller is connected to the welcome layout, and has one method, so this method's view gets inserted at the

Re: [Rails] Struggling at Rails beginner help

2012-11-19 Thread Colin Law
On 19 November 2012 18:17, Joz Private li...@ruby-forum.com wrote: So I've just dipped into Rails and I'm completely lost ... I suggest working through a good tutorial such as railstutorial.org (which is free to use online). This will show you the basics of rails. Colin -- You received this

[Rails] Re: Struggling at Rails beginner help

2012-11-19 Thread Max
+1 on Colin's response On Monday, November 19, 2012 11:17:40 AM UTC-7, Ruby-Forum.com User wrote: So I've just dipped into Rails and I'm completely lost ... I have a very simple website. There are 2 layouts, application and welcome. The route begins at the welcome layout. The main

Re: [Rails] Struggling at Rails beginner help

2012-11-19 Thread Hassan Schroeder
On Mon, Nov 19, 2012 at 10:17 AM, Joz Private li...@ruby-forum.com wrote: So I've just dipped into Rails and I'm completely lost ... p align=centerfont size=24%= @message %/font/p Besides the excellent suggestion to work through a Rails tutorial -- If you intend to do web development, please

[Rails] Re: Multiple models and views in 'transactions'

2012-11-19 Thread jmcguckin
I wonder... Is there a possibility that if your database has multiple tables that are related with foreign keys, whilst a user is filling in fields of forms, etc - is it possible for another web user to overwrite records or to create records with the same id that would later get overwritten by

[Rails] Re: can I access session variable in model

2012-11-19 Thread Vu R.
We can do that with attr_accessor In model attr_accessible :site_id attr_accessor :site_id in form, add a hidden field like this =f.site_id, value; session[:site_id] in model we can use self.site_id now. -- Posted via http://www.ruby-forum.com/. -- You received this message because you