[Rails] Depot app from 'Agile Web Development with Rails'

2010-09-19 Thread Mitko Kostov
In the book 'Agile web development with Rails, the authors are building a store-like app. At some point they add dynamic adding a product with ajax call. [code] !-- store_controller#index -- % form_remote_tag :url = { :action = 'add_to_cart', :id = product } do % %= submit_tag Add to Cart % %

[Rails] Re: Why freeze memoization?

2010-09-19 Thread trans
On Aug 25, 2:55 am, Frederick Cheung frederick.che...@gmail.com wrote: to protect you from stuff like foo = bar.memoized_method foo.gsub!(...) #do something with foo If you did this and foo wasn't frozen then you'd alter what memoized_method returned for all future calls - probably not

[Rails] Re: how to increase the time-out

2010-09-19 Thread Robert Pankowecki (rupert)
Passenger 3 will have MinInstances option so you could say that you always want at least 1 instance ready to serve next request. Robert Pankowecki -- 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

[Rails] Re: Performing nested queries in rails

2010-09-19 Thread Robert Pankowecki (rupert)
On Sep 17, 6:22 am, vishy shubhambansa...@gmail.com wrote: I am fairly new to rails and trying to learn rails by creating some projects on my own. I am trying to perform a geo search on a restaurant model and I am using geokit for that. My model stores the latitude and longitude for the

[Rails] Re: Adding parent record to all tables

2010-09-19 Thread Robert Pankowecki (rupert)
In other words your problem was to set the organization in every created model without pain ? Ruby is not singlethreaded. You can even make your Rails app using multiple Thread by calling setting threadsafe in Rails configuration. I think Rails is threadsafe since 2.2 version. Instead of class

[Rails] Re: Different databases for different sub domains

2010-09-19 Thread Robert Pankowecki (rupert)
On Sep 19, 1:46 am, Marnen Laibow-Koser li...@ruby-forum.com wrote: Don't do that.  I saw the other thread, and I think you were given bad advice.  You almost always want one big DB for the whole thing.  It's usually easier to deal with. Any reason why it is wrong to do that ? Why is it easier

Re: [Rails] Re: Commenting in an ERB without generating a compiling error

2010-09-19 Thread Michael Pavling
On 18 September 2010 22:05, Marnen Laibow-Koser li...@ruby-forum.com wrote: nobosh wrote: doesn't have a simpilar way to comment things out in the view. Sure it does: %# comment % That won't help him comment his td though... You should probably be using Haml instead of ERb, though. Why?

Re: [Rails] Re: undefined method `to_sym' for nil:NilClass

2010-09-19 Thread Commander Johnson
I was using the to-csv and fastercsv gem. When I commented them out of my environment.rb, the error disappeared. I don't know which gem was causing it, but not using either of them has fixed it for now. I will still need CSV export functionality, but now I can at least test if it doesn't break

[Rails] Learn Ruby in which version?

2010-09-19 Thread Nich
Hi, There are some free books that were recommended to learn ruby, but these books are in Ruby 1.6 (Programming Ruby The Pragmatic Programmer's Guide) and another one in Ruby 1.8. Is it fine to learn from these books based on older versions, when right now Ruby 1.8.7 and Ruby 1.9.2 are

[Rails] Re: Calling a Javascript method from a view

2010-09-19 Thread Abder-Rahman Ali
I figured the issue out. I wanted an alert to show up, and had this statement BEFORE the alert: return imageWidth; So, I had to remove it to see the alert, since it seems that the block will exit after the return statement. -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: Calling a Javascript method from a view

2010-09-19 Thread Abder-Rahman Ali
When I try to call the getHeight() and getWidth() functions I get two message box telling: RJS error: TypeError: image is null And, getWidth(); I get that when I do the following in show.html.erb: %= javascript_include_tag coordinate % canvas id=draw height = %= update_page_tag do |page|

Re: [Rails] Re: Calling a Javascript method from a view

2010-09-19 Thread radhames brito
are you using any library? -- 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

[Rails] Re: Re: Calling a Javascript method from a view

2010-09-19 Thread Abder-Rahman Ali
radhames brito wrote: are you using any library? I'm using Paperclip to upload an image in my model. -- 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

Re: [Rails] Depot app from 'Agile Web Development with Rails'

2010-09-19 Thread radhames brito
surely , but i warn you that that tutorial is very old, there are better way to do everything now. [code] !-- store_controller#index -- % form_remote_tag :url = { :action = 'add_to_cart', :id = product } do % %= text_field_tag :quantity% %= submit_tag Add to Cart % % end % [/code] [code] #

Re: [Rails] Depot app from 'Agile Web Development with Rails'

2010-09-19 Thread radhames brito
forgot to add the 'end' current_item = CartItem.new(product) unless params[:quantity].blank? current_item.quantity = params[:quantity] end -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group,

Re: [Rails] Re: Re: Calling a Javascript method from a view

2010-09-19 Thread radhames brito
looks like you are not using any javascript library but are calling a prototype method or something var img = document.getElementById(dicom_image); var width = img.clientWidth; var height = img.clientHeight; On Sun, Sep 19, 2010 at 8:15 AM, Abder-Rahman Ali li...@ruby-forum.comwrote:

[Rails] Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread Abder-Rahman Ali
radhames brito wrote: looks like you are not using any javascript library but are calling a prototype method or something var img = document.getElementById(dicom_image); var width = img.clientWidth; var height = img.clientHeight; So, what do you think should I do to solve the issue? --

Re: [Rails] Learn Ruby in which version?

2010-09-19 Thread radhames brito
http://apress.com/book/view/9781590597668 includes ruby 1.9 On Sat, Sep 18, 2010 at 8:42 PM, Nich nich...@gmail.com wrote: Hi, There are some free books that were recommended to learn ruby, but these books are in Ruby 1.6 (Programming Ruby The Pragmatic Programmer's Guide) and another one

Re: [Rails] Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
models are accessible from all levels of the application, so you can access them the same way you access them from controllers -- 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

[Rails] Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
Thanks radhames. Can you kindly show me a way on how to code this? As I have been stuck on that for a while. 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, send

Re: [Rails] Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread radhames brito
If you are learning and want to learn how to do everything nice and efficiently learn how to use a javascript library, if you are in a hurry and dont have time to learn keep doing it the way you have. The code i gave you is for when you are not using any library. with jquery it would have been as

[Rails] Re: Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread Abder-Rahman Ali
radhames brito wrote: If you are learning and want to learn how to do everything nice and efficiently learn how to use a javascript library, if you are in a hurry and dont have time to learn keep doing it the way you have. The code i gave you is for when you are not using any library.

Re: [Rails] Re: Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread radhames brito
because without library is var width = document.getElementById('dicom_image').clientWidth; or var image = document.getElementById('dicom_image'); var width = image.clientWidth; but you are calling image.width; On Sun, Sep 19, 2010 at 9:30 AM, Abder-Rahman Ali li...@ruby-forum.comwrote:

Re: [Rails] Re: Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
show the code where you are trying to access, ill see whats wrong with it On Sun, Sep 19, 2010 at 9:23 AM, Abder-Rahman Ali li...@ruby-forum.comwrote: Thanks radhames. Can you kindly show me a way on how to code this? As I have been stuck on that for a while. Thanks. -- Posted via

[Rails] Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
radhames brito wrote: show the code where you are trying to access, ill see whats wrong with it Thanks @radhames. The main issue is how to make a call to the height() and width() methods in the model in this line in show.html.erb: canvas id=draw height = ? width= ? /canvas This is

[Rails] Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
@radhames. If you want me to send you the whole application, can you sen me your email? I don't know if you can send me a private message through www.ruby-forum.com? Thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

[Rails] Re: How to access a model method from within a view?

2010-09-19 Thread Frederick Cheung
On Sep 19, 3:11 pm, Abder-Rahman Ali li...@ruby-forum.com wrote: radhames brito wrote: show the code where you are trying to access, ill see whats wrong with it Thanks @radhames. The main issue is how to make a call to the height() and width() methods in the model in this line in

[Rails] Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
Frederick Cheung wrote: On Sep 19, 3:11�pm, Abder-Rahman Ali li...@ruby-forum.com wrote: /canvas What's wrong with %= some_object.width % ? Fred I tried: canvas id=draw height = @dicom.height width= @dicom.width /canvas But, I don't the expected dimensions. As when I calculated the

Re: [Rails] Re: How to access a model method from within a view?

2010-09-19 Thread Colin Law
On 19 September 2010 15:29, Abder-Rahman Ali li...@ruby-forum.com wrote: Frederick Cheung wrote: On Sep 19, 3:11�pm, Abder-Rahman Ali li...@ruby-forum.com wrote: /canvas What's wrong with %= some_object.width % ? Fred I tried: canvas id=draw height = @dicom.height width= @dicom.width

[Rails] Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
Colin Law wrote: On 19 September 2010 15:29, Abder-Rahman Ali li...@ruby-forum.com wrote: Frederick Cheung wrote: On Sep 19, 3:11�pm, Abder-Rahman Ali li...@ruby-forum.com wrote: /canvas What's wrong with %= some_object.width % ? Fred I tried: canvas id=draw height = @dicom.height

[Rails] Re: How to access a model method from within a view?

2010-09-19 Thread Agoofin
If this is only in the show method - one record, I assume, why not pass the height and width as instance variables in the method call which are then available in the view? On Sep 19, 10:11 am, Abder-Rahman Ali li...@ruby-forum.com wrote: radhames brito wrote: show the code where you are trying

[Rails] Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
Bb Serviss wrote: If this is only in the show method - one record, I assume, why not pass the height and width as instance variables in the method call which are then available in the view? Thanks @Bb. How do you think this can be done? -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Documentation for active record validates helper

2010-09-19 Thread Daniel Lidström
http://www.railsapi.com/doc/rails-v3.0.0/classes/ActiveModel/Validati... -- Greg Donald destiney.com | gregdonald.com Thank you Greg! Daniel -- 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

Re: [Rails] Learn Ruby in which version?

2010-09-19 Thread Fred Ballard
http://apress.com/book/view/1430223634 includes Ruby 1.9 On Sun, Sep 19, 2010 at 8:18 AM, radhames brito rbri...@gmail.com wrote: http://apress.com/book/view/9781590597668 includes ruby 1.9 On Sat, Sep 18, 2010 at 8:42 PM, Nich nich...@gmail.com wrote: Hi, There are some free books

Re: [Rails] Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
ok, im back. has_attached_file :photo, :styles = { :original = [100%, :jpg], } === this here is incomplete and is you are only having the original image there is no need to specify the style, and paperclip wont convert the image to jpg, also is not good to put convertion in the same thread

Re: [Rails] Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
is not recognized by the 'identify' command. you are running the paperclip on windows , you have to hack it so that the command can be executed by the cmd.exe in this branch is suppose to be fixed http://github.com/ghazel/paperclip.git -- You received this message because you are subscribed

[Rails] Re: Different databases for different sub domains

2010-09-19 Thread Marnen Laibow-Koser
Robert Pankowecki wrote: On Sep 19, 1:46�am, Marnen Laibow-Koser li...@ruby-forum.com wrote: Don't do that. �I saw the other thread, and I think you were given bad advice. �You almost always want one big DB for the whole thing. �It's usually easier to deal with. Any reason why it is wrong

[Rails] Re: Re: Commenting in an ERB without generating a compiling error

2010-09-19 Thread Marnen Laibow-Koser
Michael Pavling wrote: On 18 September 2010 22:05, Marnen Laibow-Koser li...@ruby-forum.com wrote: nobosh wrote: doesn't have a simpilar way to comment things out in the view. Sure it does: %# comment % That won't help him comment his td though... Of course it will. He can just put

[Rails] Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread Marnen Laibow-Koser
radhames brito wrote: looks like you are not using any javascript library but are calling a prototype method or something var img = document.getElementById(dicom_image); getElementById is core JavaScript, not a Prototype extension. If you're going to spread misinformation like this,

[Rails] Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
radhames brito wrote: is not recognized by the 'identify' command. you are running the paperclip on windows , you have to hack it so that the command can be executed by the cmd.exe in this branch is suppose to be fixed http://github.com/ghazel/paperclip.git I think the link is

[Rails] Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
Thanks @radhames for your thorough explanation. I still have the same issue. I think I may have a problem in making an instantiation. My model now is as follows: class Dicom ActiveRecord::Base has_attached_file :photo, :styles = { :original = [100%, :jpg], } def before_save

[Rails] Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread Abder-Rahman Ali
@Marnen. I really don't understand what you mean! -- 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-t...@googlegroups.com. To unsubscribe from this

Re: [Rails] Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread radhames brito
@Marnen Laibow-Koser getHeight() and getWidth() are prototype methods. Read before you accuse me -- 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

Re: [Rails] Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread radhames brito
he was talking to me, when you set you called getHeight() and getWidth() you used then same names prototype uses, but i didnt notice you had made your own methods with those name, so he thought that when i said radhames brito wrote: looks like you are not using any javascript library but are

Re: [Rails] Re: Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
did you created the fields in the database? do that and it should work -- 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

[Rails] Time based etags

2010-09-19 Thread badnaam
In my app I am serving certain controller actions every x many minutes. For example, most popular posts are generated in memcached every 30 minutes and served from there. I would like to use etags/last_modified so that I am not even rendering the same most_popular view for the same client within

Re: [Rails] Re: Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
and dont forget to add height and width to the attr_accessible list and fix this height = dimensions.height width = dimensions.width to self.height = dimensions.height self.width = dimensions.width also you can remove the style from has_attached_file :photo, :styles = { :original =

Re: [Rails] Re: Different databases for different sub domains

2010-09-19 Thread radhames brito
For the developer is better to have one database but not for the clients, some may want their data exported in the future, or you may need to create extra id number in case some of then sequences for things like invoices, if you have one db you can use the id field for invoices. But i havent give

[Rails] Re: Numericality validation strips chars from original entry

2010-09-19 Thread jdc
I'll give that a try. I was hoping for something less manual but I can live with this. On Sep 15, 7:43 am, pepe p...@betterrpg.com wrote: Just off the top of my head and never done it but... could you reuse the params value to repopulate the field if the field has errors? I think it should be

[Rails] Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
radhames brito wrote: did you created the fields in the database? do that and it should work Yes, I have created the fields in the database as follows: rails script generate migration AddWidthToDicom width:integer And, rails script generate migration AddHeightToDicom height:integer But,

Re: [Rails] Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
sorry im an idiot def after_save uploaded_file = photo.queued_for_write[:original] dimensions = Paperclip::Geometry.from_file(uploaded_file) height = dimensions.height width = dimensions.width end end is after save not before, in the before Paperclip::Geometry.from_file(uploaded_file)

Re: [Rails] Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
let me go check that because rigth now im telling you everything from memory, ill go see the right way to do it and the reply to you -- 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

[Rails] Missing template classified/update.erb in view path app/view

2010-09-19 Thread Faisal Basha
Iam trying to build a classified site, I've created the code to add,edit,delete posts. I am facing trouble with the edit part. When I click the edit link for a post it shows the form with all the textfields,after entering in all the fields and clicking the save changes button, Iam getting the

Re: [Rails] Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
Can you wait a while ? im going to make an example project but instead of use dicom image ill use a normal image, i will upload the project to github so you can check it out. ok? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] Re: Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
radhames brito wrote: Can you wait a while ? im going to make an example project but instead of use dicom image ill use a normal image, i will upload the project to github so you can check it out. ok? @radhames, sure, that sounds great. I really appreciate your efforts. Looking forward

Re: [Rails] Re: Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread radhames brito
i just had lunch, and im going to take a nap after that ill work on it -- 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

[Rails] Re: Re: Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
radhames brito wrote: i just had lunch, and im going to take a nap after that ill work on it Take your time @radhames. Thanks a lot. :-) -- 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

Re: [Rails] Re: Re: Commenting in an ERB without generating a compiling error

2010-09-19 Thread Michael Pavling
On 19 September 2010 17:37, Marnen Laibow-Koser li...@ruby-forum.com wrote: Michael Pavling wrote: That won't help him comment his td though... Of course it will.  He can just put the whole td construct in an ERb comment tag.  ERb doesn't pay attention to HTML nesting.  Or am I

[Rails] Re: Different databases for different sub domains

2010-09-19 Thread Robert Pankowecki (rupert)
I can see some other advantages. You can easily split your application into multiple servers. That gives you the ability to upgrade clients to new application step by step instead of migrating whole bunch of data at the same time. Some clients want to upgrade today some in next week. The code to

Re: [Rails] Re: Different databases for different sub domains

2010-09-19 Thread Peter De Berdt
On 19 Sep 2010, at 19:26, radhames brito wrote: For the developer is better to have one database but not for the clients, some may want their data exported in the future, or you may need to create extra id number in case some of then sequences for things like invoices, if you have one db

[Rails] git push gives fatal error

2010-09-19 Thread Dani Dani
Hi, I'm not sure I'm right here but hope maybe there is someone who can help with this. When I do git push I get the following error: ERROR: laguna53/sample_app doesn't exist yet. Did you enter it correctly? fatal: The remote end hung up unexpectedly the error - ERROR: laguna53/sample_app

Re: [Rails] Depot app from 'Agile Web Development with Rails'

2010-09-19 Thread Rick R
On Sun, Sep 19, 2010 at 8:21 AM, radhames brito rbri...@gmail.com wrote: surely , but i warn you that that tutorial {in the book 'Agile web development with Rails} is very old, there are better way to do everything now. Are you saying they aren't using the 'better ways of doing things in

[Rails] Re: Re: Different databases for different sub domains

2010-09-19 Thread Marnen Laibow-Koser
radhames brito wrote: For the developer is better to have one database but not for the clients, some may want their data exported in the future, That's easy enough to do with one big database. or you may need to create extra id number in case some of then sequences for things like

[Rails] Re: Different databases for different sub domains

2010-09-19 Thread Marnen Laibow-Koser
Robert Pankowecki wrote: I can see some other advantages. You can easily split your application into multiple servers. Any decent DB server can do that with one DB. That gives you the ability to upgrade clients to new application step by step instead of migrating whole bunch of data at

[Rails] Re: Re: Different databases for different sub domains

2010-09-19 Thread Marnen Laibow-Koser
Peter De Berdt wrote: [...] Since our main application is CRM and ERP, I'd like to chime in here. [...] That said, we do have a separate database for every customer, for several reasons, I'll mention a few. Although we could scope everything on the customer, but given the total amount

[Rails] Re: Re: Re: Commenting in an ERB without generating a compiling error

2010-09-19 Thread Marnen Laibow-Koser
Michael Pavling wrote: On 19 September 2010 17:37, Marnen Laibow-Koser li...@ruby-forum.com wrote: Michael Pavling wrote: That won't help him comment his td though... Of course it will. �He can just put the whole td construct in an ERb comment tag. �ERb doesn't pay attention to HTML

[Rails] Re: YM4R multiple points on Google Map

2010-09-19 Thread Twistter Shock
Hunter Hillegas wrote: Can't you just feed in an array of markers? @markers.each do |marker_seq| @map.overlay_init(marker_seq) end Hi Hunter I have a similar problema with YM4R My map only display the last point, this is my code: @map = GMap.new(map_div_id)

[Rails] Re: Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread Marnen Laibow-Koser
radhames brito wrote: @Marnen Laibow-Koser getHeight() and getWidth() are prototype methods. ...which were not involved in the post you responded to as far as I can see. Read before you accuse me I did. Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from

[Rails] Re: Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread Abder-Rahman Ali
Marnen Laibow-Koser wrote: radhames brito wrote: @Marnen Laibow-Koser getHeight() and getWidth() are prototype methods. ...which were not involved in the post you responded to as far as I can see. Read before you accuse me I did. Best, --  Marnen Laibow-Koser

Re: [Rails] Missing template classified/update.erb in view path app/view

2010-09-19 Thread steve ross
Typically your show action does not allow for user input. The edit action does. In any case, is there a classified/edit.erb and if you are trying to render it, then it implies that the update failed. Do you know why? On Sep 19, 2010, at 11:03 AM, Faisal Basha wrote: Iam trying to build a

[Rails] unicorn via VirtualBox

2010-09-19 Thread Bryan Weatherly
Hopefully I'm not barking up the wrong tree here... I am attempting to use unicorn as a production web server in a Windows environment using Ubuntu 10.04 through VirtualBox. Everything works great inside the linux environment, but the pages load really slow inside the windows environment, or

[Rails] how to access the contents of a field

2010-09-19 Thread abdelkarim
hello every body i have a simple question . i have this form : %= form_tag :action='password' % Password:%= password_field :p , :pass1 , :size='20'% Again:%= password_field :p , :pass2 , :size='20'% how can i access the contents of the two field in ruby ? by doing this :

[Rails] devise issue

2010-09-19 Thread Dave Ganly
Devise is very powerful, but I am struggling to get it to do what I want - I'm very new to rails so please forgive any stupidity in the below. I followed the instructions on: http://github.com/plataformatec/devise/wiki/How-to-edit-user-form-without-current-password -- because I don't want users

Re: [Rails] Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread Colin Law
On 19 September 2010 18:52, Abder-Rahman Ali li...@ruby-forum.com wrote: radhames brito wrote: did you created the fields in the database? do that and it should work Yes, I have created the fields in the database as follows: rails script generate migration AddWidthToDicom width:integer

[Rails] Re: Re: Re: Re: How to access a model method from within a view?

2010-09-19 Thread Abder-Rahman Ali
Colin Law wrote: On 19 September 2010 18:52, Abder-Rahman Ali li...@ruby-forum.com wrote: But, still the same. Did you run the migrations? rake db:migrate Colin Yes, I did. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the

Re: [Rails] Depot app from 'Agile Web Development with Rails'

2010-09-19 Thread radhames brito
Are you saying they aren't using the 'better ways of doing things in the latest tutorial that is in their latest book for Rails 3? (Just curious because I'm using it as a guide for my learning as well.) the book for rails 3 is not out , it will be out in January 2011

[Rails] Rails 2.3.8 - InvalidAuthenticityToken problem. URGENT!

2010-09-19 Thread Rune
I used to have Simple Captcha installed, but since I removed it I got all kinds of problems with login. Processing UsersController#login (for 188.177.122.179 at 2010-09-19 12:21:09) [POST] Parameters: {commit=OK, authenticity_token=/ Y0aZETCsMhyI3CkrZJK6O2NaLEoi+LRe8ZuDPWU9kc=,

[Rails] Re: git push gives fatal error

2010-09-19 Thread Frederick Cheung
On Sep 19, 7:37 pm, Dani Dani li...@ruby-forum.com wrote: Hi, I'm not sure I'm right here but hope maybe there is someone who can help with this. When I do git push I get the following error: ERROR: laguna53/sample_app doesn't exist yet. Did you enter it correctly? fatal: The remote end

Re: [Rails] Re: Re: Different databases for different sub domains

2010-09-19 Thread Peter De Berdt
On 19 Sep 2010, at 21:03, Marnen Laibow-Koser wrote: Although we could scope everything on the customer, but given the total amount of data involved across all accounts, it would have a dramatic impact on performance over time, even with proper indexes. What makes you think so? A good DB

Re: [Rails] Depot app from 'Agile Web Development with Rails'

2010-09-19 Thread Colin Law
On 19 September 2010 22:03, radhames brito rbri...@gmail.com wrote: Are you saying they aren't using the 'better ways of doing things in the latest tutorial that is in their latest book for Rails 3? (Just curious because I'm using it as a guide for my learning as well.) the book for rails

Re: [Rails] Re: Re: Different databases for different sub domains

2010-09-19 Thread radhames brito
Then why post? uff good thing i ran -- 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

Re: [Rails] Depot app from 'Agile Web Development with Rails'

2010-09-19 Thread radhames brito
Yes but only if you buy it from pragmatic bookshelf ( i didnt : / ) its UD$53, but at amazon they have it for US$29. anyway i assumed he has the 3 edition. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

Re: [Rails] Re: Re: Re: Re: Calling a Javascript method from a view

2010-09-19 Thread radhames brito
@Marnen Laibow-Koser from Abder-Rahman Ali getWidth() is involved. If you check my question, you will see the following: i rest my case your honor. -- 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

[Rails] Re: Different databases for different sub domains

2010-09-19 Thread Robert Pankowecki (rupert)
On Sep 19, 8:59 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Robert Pankowecki wrote: I can see some other advantages. You can easily split your application into multiple servers. Any decent DB server can do that with one DB. I know. I meant the situation when there are so many data

Re: [Rails] devise issue

2010-09-19 Thread radhames brito
I had to copy my devise/registrations views out to just views/registrations. did you do that in the gem? because you are suppose to use rails g devise_views to do that to edit without requiring a password put this in your user model def password_required? self.new_record? end -- You received

Re: [Rails] Missing template classified/update.erb in view path app/view

2010-09-19 Thread radhames brito
your show action looks like the edit action should look, and then you are rendering edit if something goes wrong , that is not the way def update @classifed = Classified.find(params[:id]) if @classified.update_attributes(params[:classified]) redirect_to :action = 'show', :id =

[Rails] Re: Re: Re: Different databases for different sub domains

2010-09-19 Thread Marnen Laibow-Koser
Peter De Berdt wrote: On 19 Sep 2010, at 21:03, Marnen Laibow-Koser wrote: Although we could scope everything on the customer, but given the total amount of data involved across all accounts, it would have a dramatic impact on performance over time, even with proper indexes. What makes you

[Rails] Re: devise issue

2010-09-19 Thread Dave Ganly
radhames brito wrote: I had to copy my devise/registrations views out to just views/registrations. did you do that in the gem? because you are suppose to use rails g devise_views to do that to edit without requiring a password put this in your user model def password_required?

[Rails] Re: Numericality validation strips chars from original entry

2010-09-19 Thread pepe
I'm sorry but I don't know of a shorter way of doing this. However, going back to the original problem I think that it might be better to do this in the model itself from a design point of view. I think the model should be able to handle this and leave the controller unaware of the problem. In

Re: [Rails] Re: YM4R multiple points on Google Map

2010-09-19 Thread Walter McGinnis
Just a quick link to some example code that may help you: http://github.com/kete/kete/blob/master/app/views/search/_results.rhtml # lines 43 - 63ish Pay particular attention to lines 61 and 62. Hope that helps, Walter -- You received this message because you are subscribed to the Google

[Rails] Setting up email registration with Authlogic (couple questions)?

2010-09-19 Thread Rick R
I'm pretty new to rails and I having troubling finding examples on how to setup email registration with Authlogic (rails3 ruby 1.9.) (I have authlogic working fine with Rails3 minus the email registration part.) The Authlogic docs seem pretty weak in helping me understand 'what I need to do.'

[Rails] Re: Setting up email registration with Authlogic (couple questions)?

2010-09-19 Thread elliottg
It looks like Rails 2 style mailers are being used for github.com/ matthooks/authlogic-activation-tutorial. That may be where your feeling some pain since your working on a Rails 3 app. I just re-wrote an Authlogic acct. activation flow from Rails 2 to Rails 3 and using the new mailer code was

[Rails] How does one get a Rails 3 app name

2010-09-19 Thread elliottg
From within a Rails 3 Gem I'm working on, I need to get the app's name. i.e., the value of the module that wraps the application class in application.rb. Is there some global-syle variable that contains that? #application.rb module MyAppName class Application Rails::Application end end

Re: [Rails] Re: Setting up email registration with Authlogic (couple questions)?

2010-09-19 Thread Rick R
On Sun, Sep 19, 2010 at 9:56 PM, elliottg x...@simplecircle.net wrote: It looks like Rails 2 style mailers are being used for github.com/ matthooks/authlogic-activation-tutorial. That may be where your feeling some pain since your working on a Rails 3 app. I just re-wrote an Authlogic acct.

Re: [Rails] Re: devise issue

2010-09-19 Thread radhames brito
Oh sorry i dont use the registration controller so maybe thats why i didnt know that -- 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,

[Rails] Modal pop up

2010-09-19 Thread Sahana Ra
I have a link which opens the modal pop fading the background. I have this line of code to create the pop up %= javascript_tag new Popup('new_author_popup','new_author_link',{modal:true}) % Popup comes up but the problem I've is everything fades including the popup. I don't know what is causing

Re: [Rails] How does one get a Rails 3 app name

2010-09-19 Thread Daniel Gaytán
Rails.application.class.parent Daniel Gaytán 2010/9/19 elliottg x...@simplecircle.net From within a Rails 3 Gem I'm working on, I need to get the app's name. i.e., the value of the module that wraps the application class in application.rb. Is there some global-syle variable that contains

Re: [Rails] how to access the contents of a field

2010-09-19 Thread Rajinder Yadav
On 10-09-19 04:18 PM, abdelkarim wrote: hello every body i have a simple question . i have this form : %= form_tag :action='password' % Password:%= password_field :p , :pass1 , :size='20'% Again:%= password_field :p , :pass2 , :size='20'% how can i access the contents of the two field in

Re: [Rails] how to access the contents of a field

2010-09-19 Thread Rajinder Yadav
correction: sorry for the typo, you can access the values from your controller like this: ch1 = params[:pass1] ch2 = params[:pass2] -- Kind Regards, Rajinder Yadav -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group,

[Rails] Re: Mysql2 throws errors on invalid dates. Need suggestion for catching

2010-09-19 Thread Robert Rouse
I'm not in control of the data and it comes in external to my app. It's an infrastructure I can't change. If I had control, I would do what you suggested. On Sep 14, 3:12 am, Wincent Colaiuta w...@wincent.com wrote: On 14 sep, 07:11, Robert Rouse robert.e.ro...@gmail.com wrote: I know I

  1   2   >