[Rails] form_for with multiple objects, each with a preset attribute?

2009-05-13 Thread Jacob Patton
I'm using Rails to create a schedule of a shop's opening and closing hours. Simplified versions of the models I've set up is: class Account ActiveRecord::Base has_many :opening_hours, :dependent = :destroy end class OpeningHour ActiveRecord::Base belongs_to:account # table

[Rails] Multilingual model content

2009-05-13 Thread Michael Rigart
Hi I'm looking for some insight in a small problem I have. I allready posted this in the Rails I18n forum, but didn't got any respond, so maybe it was just the wrong forum. I need multilingual input in my models. Lets say you have a Product model. That product contains title, description and

[Rails] Re: Multilingual model content

2009-05-13 Thread Francesc Esplugas
On Wed, May 13, 2009 at 8:56 AM, Michael Rigart rails-mailing-l...@andreas-s.net wrote: I need multilingual input in my models. Lets say you have a Product model. That product contains title, description and price. The price is allways the same, but the title and description need to be

[Rails] Re: Multilingual model content

2009-05-13 Thread Michael Rigart
Francesc Esplugas wrote: On Wed, May 13, 2009 at 8:56 AM, Michael Rigart rails-mailing-l...@andreas-s.net wrote: I need multilingual input in my models. Lets say you have a Product model. That product contains title, description and price. The price is allways the same, but the title and

[Rails] Re: Multilingual model content

2009-05-13 Thread Francesc Esplugas
On Wed, May 13, 2009 at 9:09 AM, Michael Rigart rails-mailing-l...@andreas-s.net wrote: it looked good till I started reading further. I saw that you need to define every language that you want to support in your attributes. The thing I wanted to do is make sure that the list of supported

[Rails] Re: Multilingual model content

2009-05-13 Thread Gianluca Tessarolo
Hi Michael, if you want to have dynamic language support the best choice may be: http://github.com/janne/model_translations/ or (better) http://github.com/joshmh/globalize2/ and if you want the versions for your translations: http://github.com/joshmh/globalize2_versioning/ The only problem

[Rails] Re: Integration testing edit actions (PUT method)

2009-05-13 Thread Jarl Friis
Starr Horne st...@chatspring.com writes: What does people do here? ignore the fact that the integration test generate HTTP request which differs from what a broswer will do, or do you use post (or post_via_redirect) and adding the _method parameter manually. I think you're just splitting

[Rails] Re: Multilingual model content

2009-05-13 Thread Francesc Esplugas
Taking a look at the code, maintenance and test coverage in my opinion model_translations it's a better solution than translate_columns. http://github.com/janne/model_translations/tree/master On Wed, May 13, 2009 at 9:31 AM, Michael Rigart rails-mailing-l...@andreas-s.net wrote: I'm

[Rails] Re: CMS and REST - best practices

2009-05-13 Thread John Small
wejrow...@gmail.com wrote: No, I want to build it myself.. I look at it though. So what is the best practice? Should I build a separate section with its own controllers to edit them? or make a separate private view within the component controller? I started looking at Adva (see

[Rails] Re: Multilingual model content

2009-05-13 Thread Michael Rigart
Francesc Esplugas wrote: Taking a look at the code, maintenance and test coverage in my opinion model_translations it's a better solution than translate_columns. http://github.com/janne/model_translations/tree/master On Wed, May 13, 2009 at 9:31 AM, Michael Rigart Hmm, indeed, its

[Rails] Re: Multilingual model content

2009-05-13 Thread Michael Rigart
Hi, I'm going to take a look at the RailsTranslateColumnsPlugin. Maybe I can get some ideas from there. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: CMS and REST - best practices

2009-05-13 Thread Francesc Esplugas
On Wed, May 13, 2009 at 9:39 AM, John Small rails-mailing-l...@andreas-s.net wrote: The other thing I don't like about it is the assumption that a CMS is used solely for publishing articles. I guess if you spend your life blogging then that's a sensible assumption, but most websites aren't

[Rails] Re: Upload file with url parameter

2009-05-13 Thread Peter Vandenberk
Hi Bennet, On 12 May 2009, at 13:07, PyroHiroshi wrote: On May 11, 12:39 pm, Frederick Cheung frederick.che...@gmail.com wrote: On May 11, 11:11 am, hongseok.com hongseok.y...@gmail.com wrote: I just want the client(kind a application running automatically) to uploadfileto the web

[Rails] contact us form (n00b)

2009-05-13 Thread bhan...@hcinsight.com
Im at a loss..and its something with my routes.. i have an index.html.erb that generates a partial % page_title(Contact Us) % % content_for :banner do % %= render :partial = 'contacts/banner' % % end % %= render :partial = 'contacts/form' % The partial in the contacts directory

[Rails] ActionController::RoutingError - Functional Tests and :path_prefix in routes.rb

2009-05-13 Thread Pablo Alonso García
Hi, I'm trying to write a test for my ProfilesController, which I mapped in my routes.rb, using: map.resource :profile, :path_prefix = ':account' This way, I have routes like: profile POST /:account/profile {:controller=profiles, :action=create} formatted_profile POST

[Rails] Re: forms link css classes - not working

2009-05-13 Thread Jim
It's not supposed to be 'style', it's 'class'. a href=/galleries/1 class=urgentDestroy/a and input class=m_title id=gallery_name name=gallery[name] size=80 type=text value=Camp 09 / On May 12, 7:16 pm, wejrow...@gmail.com wejrow...@gmail.com wrote: I used a scaffold to create an interface.

[Rails] Re: Invalid authenticity token only in IE6

2009-05-13 Thread ianneub
We are seeing the same issue, but we're not using the restful- authentication plugin. Are you using jQuery or Prototype at all? On May 3, 8:26 pm, Andrew luckyd...@gmail.com wrote: Hi guys, I just discovered that both logging in and signing up does not work in IE6 due to

[Rails] Re: Installing Warehouse- undefined symbol: apr_dbm_type_db

2009-05-13 Thread Diona
I just ran into this issue. Upon running the command RAILS_ENV=production rake db:schema:load a second time, I received no error. dionak --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

[Rails] ruby script outside of rails app

2009-05-13 Thread phillee
Hello: I would like to write a ruby script that runs on its own, but still take advantage of the ActiveRecord configured by the web app. Is there an easy way to do this? Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are

[Rails] Re: a problem http POST params

2009-05-13 Thread Matthew MacLeod
On May 13, 6:12 am, Yongning Liang liangyongn...@gmail.com wrote: Does RoR has an easy way to tell different about GET and POST params just like $_GET and $_POST in PHP? You can use the request object: case request.method when :get #Do stuff for GET method return when :post #Do stuff

[Rails] Re: Deleting Sessions with no logout

2009-05-13 Thread Colin Law
2009/5/12 Shandy Nantz rails-mailing-l...@andreas-s.net Colin Law wrote: I think you may find there is no reliable way of achieving this, there was a significant thread on this issue a little while ago. What is the unwanted behaviour that you are seeing? Perhaps there is a better

[Rails] Re: Apache / mod_rails config

2009-05-13 Thread Jeremy Olliver
Hi George, This is a bit outside the scope of this group, but how you set that up doesn't really have anything to do with the mod_rails install. From what I know, you should just be able to create a new virtual host and point it to the folder of files you want to serve. Mod rewrite would only be

[Rails] Re: ruby script outside of rails app

2009-05-13 Thread Jeremy Olliver
Hi Phil, you sure can. For offline tasks, I usually go with a rake task (http:// railscasts.com/episodes/127-rake-in-background) or writing a ruby script which is executed with ruby script/runner (this makes it similar to running script/console and typing the code yourself). However if all you

[Rails] Recaptcha plugin problem

2009-05-13 Thread eng. Ilian Iliev
Hi all, I am using radiant CMS and I am trying to create custom extension and add recaptcha validation to it but when I call if not verify_recaptcha(:private_key = 'aaa') #add error end I get: undefined method `verify_recaptcha' for #Comment:0x4f4c460 Bellow is the full code

[Rails] compare this sql query and corresponding ruby code

2009-05-13 Thread Sijo Kg
Hi Suppose I have a two models Ticket and Activity Ticket has_many activities Activity belongs_to Ticket Now suppose if the Activity has field name Now for a Ticket with id=1 say there are 10 activities So to update name of all activities I can directly wite the sql statement update

[Rails] Updtade 2.2.2 to 2.3.2

2009-05-13 Thread Fresh Mix
How can I updated my rails 2.2.2 project to 2.3.2? Chane RAILS_GEM_VERSION = '2.3.2' and ??? -- 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

[Rails] What’s faster for getting Mails into Rails: Pop vs. MySQL

2009-05-13 Thread Olaf S.
Hi, Suppose I wanted to get mails from my mailserver (different machine) into my Rails App to process it there, what is faster: * Connecting via net/Pop or net/imap to download the mails * Storing the Mails on the Mailserver in a MySQL Database (using something like DBMail) and then connecting

[Rails] Re: compare this sql query and corresponding ruby code

2009-05-13 Thread Sijo Kg
Hi I tried like Activity.update_all(name='hi', :conditions = [ticket_id =?,1]) But getting error ActiveRecord::StatementInvalid: RuntimeError: ERROR C42703 Mcolumn activities.conditions does not existP42 Fparse_func.c L1104 Runknown_attribute: UPDATE activities SET name='hi'

[Rails] Re: compare this sql query and corresponding ruby code

2009-05-13 Thread Maurício Linhares
Here's the correct sintax: Activity.update_all( [ 'name = ?', 'hi' ] , [ticket_id =?,1]) - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Wed, May 13, 2009 at 8:24 AM, Sijo Kg rails-mailing-l...@andreas-s.net wrote: Hi  I tried like

[Rails] Re: Updtade 2.2.2 to 2.3.2

2009-05-13 Thread Olaf S.
Fresh Mix wrote: How can I updated my rails 2.2.2 project to 2.3.2? Chane RAILS_GEM_VERSION = '2.3.2' and ??? How about updating your rails gem first # gem rails update Then maybe freeze it Appdir # rake rails:freeze:edge RELEASE=2.3.2 And of course change your enviroment.rb as you

[Rails] Login for iPhone webapp

2009-05-13 Thread Pål Bergström
I can't get a login action to work for an iPhone webapp (using the iPhone Simulator). Is there anything special that I should think about for a login action on the iPhone? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

[Rails] Re: What is the sequential steps of installing RoR?

2009-05-13 Thread sheru
Hi, I have installed ruby186-27_rc2 on windows xp for the developement. Now I have questions: - How do I know now the ruby installed successfully where do I write coding? - Does package install rubygems automatically or need to do manually? Thank you for your suggestion Sheru On May 11,

[Rails] Re: Updtade 2.2.2 to 2.3.2

2009-05-13 Thread Colin Law
Don't forget rake rails:update to update scripts, boot etc 2009/5/13 Olaf S. rails-mailing-l...@andreas-s.net Fresh Mix wrote: How can I updated my rails 2.2.2 project to 2.3.2? Chane RAILS_GEM_VERSION = '2.3.2' and ??? How about updating your rails gem first # gem rails update

[Rails] How to ultimately override rails headers?

2009-05-13 Thread Piotr Wlodarek
How to ultimately override any/all rails headers, including X-Runtime, Set-Cookie, etc. As you know, standard response.headers[Set-Cookie] = '' in after_filter will often *not* work, as rails overrides some headers. TIA, Qertoip -- Posted via http://www.ruby-forum.com/.

[Rails] Selenium - tips for avoiding a hundred fixture files.

2009-05-13 Thread Max Williams
I've just started using Selenium with Rspec and it's working well so far. However, i'm testing it against my local development version of the site (ie running in mongrel). What i really need to do is run it in a test environment, so i can do destructive actions repeatedly. Using fixtures seems

[Rails] Re: Ruby training? Worry no more.

2009-05-13 Thread Kevin Skoglund
Garfeee, Thanks for the kind words and recommendation. Ruby on Rails Essential Training is being updated for Rails v3 and I'll be releasing a separate Ruby Essential Training soon. Best, Kevin --~--~-~--~~~---~--~~ You received this message because you are

[Rails] Using adobe contribute on a rails project

2009-05-13 Thread Sergio Ruiz
we are currently trying to allow one of our clients to access and edit some html files on their site via adobe's contribute. the files live in the public directory of the rails site, and it seems like there is a problem with contribute connecting to the site. it looks like contribute is

[Rails] application design : background process

2009-05-13 Thread Adam Akhtar
Hi im making a simple app which takes a users search term and scrapes several sites rss feeds for relevant results. The scrape can take upto 10seconds. I want to make this a background process so I can update the user with the scrapes status(currently scraping site x) and present results as they

[Rails] Counting

2009-05-13 Thread Remco Swoany
Hi, I generate and download a cvs from my (HBX)stats-tool. The data is campaign-history value for tracking the hisitory of campaigns Campaign-history Orders Direct 4 Direct~Direct 6 adwords2 adwords~direct~direct 4 organic12

[Rails] [ANN] Blue Ridge 1.0: JavaScript Unit Testing for Rails

2009-05-13 Thread Jason Rudolph
Blue Ridge 1.0 has been released! Blue Ridge by Relevance, http://thinkrelevance.com Blue Ridge is a JavaScript testing plugin for Rails. It provides support for both command-line and in-browser JavaScript unit tests, and it brings the goodness of test-driven and behavior-driven

[Rails] Re: application design : background process

2009-05-13 Thread Francesc Esplugas
I would use Workling + Starling, or the run_later plugin. You can find all of them at Github. On Wed, May 13, 2009 at 4:01 PM, Adam Akhtar rails-mailing-l...@andreas-s.net wrote: Im looking at backgroundrb and have read a guide in Advanced Rails Recipe however thats for an older version of

[Rails] Problem with mongrel server (FC8) :

2009-05-13 Thread aPpLe
Hi, I have some problem with mongrel server. While I am trying access http://localhost:3000, getting the following error message mongrel_rails start ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific

[Rails] Grouping in tables

2009-05-13 Thread John Small
I have an app which uses ActiveResource to get data from a non-Rails client. One of the things it has to do is display that data in a webpage, with subtotals by week. What's an easy way to break up a collection of ARes instances by a column so I can then pump each group into a partial. The

[Rails] Re: Selenium - tips for avoiding a hundred fixture files.

2009-05-13 Thread Marnen Laibow-Koser
Max Williams wrote: I've just started using Selenium with Rspec and it's working well so far. However, i'm testing it against my local development version of the site (ie running in mongrel). What i really need to do is run it in a test environment, so i can do destructive actions

[Rails] Re: Selenium - tips for avoiding a hundred fixture files.

2009-05-13 Thread WJSimacek
On May 13, 9:18 am, Marnen Laibow-Koser rails-mailing-l...@andreas- s.net wrote: Max Williams wrote: I've just started using Selenium with Rspec and it's working well so far.  However, i'm testing it against my local development version of the site (ie running in mongrel).  What i really

[Rails] Re: Implementing ruby-openid 2.1.6 using TDD

2009-05-13 Thread WJSimacek
On May 12, 7:55 am, wayne.sima...@gmail.com wayne.sima...@gmail.com wrote: I'm trying to implement ruby-openid 2.1.6 using TDD. Many of the resources I've been using to research the plugin open_id_authentication and RESTful-authentication were written back in 2007 and don't work, and also

[Rails] Re: Using adobe contribute on a rails project

2009-05-13 Thread Colin Law
If the url of the root of your rails app is www.domain.com then www.domain.com/filename.txt will look in the /public directory. Try accessing a file there from your browser to check this is working. Colin 2009/5/13 Sergio Ruiz rails-mailing-l...@andreas-s.net we are currently trying to allow

[Rails] Re: Using adobe contribute on a rails project

2009-05-13 Thread Colin Law
2009/5/13 Colin Law clan...@googlemail.com If the url of the root of your rails app is www.domain.com then www.domain.com/filename.txt will look in the /public directory. Try accessing a file there from your browser to check this is working. Colin On the other hand this may only be true

[Rails] Re: application design : background process

2009-05-13 Thread Adam Akhtar
can they perform tasks dynamically i.e. a task is initiated on a users mouse click. I thought i saw a railscast that said they were only good for prescheduled tasks. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

[Rails] Re: Implementing ruby-openid 2.1.6 using TDD

2009-05-13 Thread Colin Law
2009/5/13 WJSimacek wayne.sima...@gmail.com On May 12, 7:55 am, wayne.sima...@gmail.com wayne.sima...@gmail.com wrote: I'm trying to implement ruby-openid 2.1.6 using TDD. Many of the resources I've been using to research the plugin open_id_authentication and RESTful-authentication

[Rails] Re: SocketError (getaddrinfo: Name or service not known)

2009-05-13 Thread daociyiyou
hi Tom My ftp directory setting is right.ftp api need port to be specified? I got another error ### Net::FTPPermError (500 Illegal PORT command. ): ### My codes is ### Net::FTP.open('showreelfinder.com') do |ftp| ftp.login('heywatch','JRnu4bNtXk') ftp.chdir('thumbnail')

[Rails] Re: Deleting Sessions with no logout

2009-05-13 Thread Shandy Nantz
Colin Law wrote: 2009/5/12 Shandy Nantz rails-mailing-l...@andreas-s.net It has to do with the sessions which are holding id for the current users logged in. At most, there may be three session variables set - the two above and another called session[:admin]. An admin can move from

[Rails] Re: Deleting Sessions with no logout

2009-05-13 Thread Colin Law
I still do not understand the problem you are seeing. Colin 2009/5/13 Shandy Nantz rails-mailing-l...@andreas-s.net Colin Law wrote: 2009/5/12 Shandy Nantz rails-mailing-l...@andreas-s.net It has to do with the sessions which are holding id for the current users logged in. At most,

[Rails] Re: Using adobe contribute on a rails project

2009-05-13 Thread Sergio Ruiz
unfortunately, none of the files are accessible by the browser.. since they all live outside the of the area served by apache.. the app is served via apache.. through a proxy.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this

[Rails] Getting and setting ruby tags in controller

2009-05-13 Thread Hamid Raza
I want to access the divs in the controller and want to change its attributes , is it possible in ruby on rails. plz help me out... -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails] Order numbers by value

2009-05-13 Thread Shandy Nantz
I have this drop-down that get populated with stuff. As I have recently found out, this stuff will either be all string values or all numerical values. I have the string values being ordered correctly but the numerical values are not. For example, this sequence of numbers 7007, 7100, 70100, 7009,

[Rails] Re: Using adobe contribute on a rails project

2009-05-13 Thread Colin Law
The rails project public folder must be accessible, that is where all the js, css files etc live 2009/5/13 Sergio Ruiz rails-mailing-l...@andreas-s.net unfortunately, none of the files are accessible by the browser.. since they all live outside the of the area served by apache.. the app is

[Rails] Re: Order numbers by value

2009-05-13 Thread Colin Law
You could convert them to integer, sort and convert back to string. There may well be a neater way as this is ruby, I don't know. 2009/5/13 Shandy Nantz rails-mailing-l...@andreas-s.net I have this drop-down that get populated with stuff. As I have recently found out, this stuff will either

[Rails] Re: Using adobe contribute on a rails project

2009-05-13 Thread Sergio Ruiz
Colin Law wrote: The rails project public folder must be accessible, that is where all the js, css files etc live accessible as in correct permissions? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are

[Rails] Re: Order numbers by value

2009-05-13 Thread Marnen Laibow-Koser
On May 13, 11:03 am, Shandy Nantz rails-mailing-l...@andreas-s.net wrote: I have this drop-down that get populated with stuff. As I have recently found out, this stuff will either be all string values or all numerical values. I have the string values being ordered correctly but the numerical

[Rails] Re: Using adobe contribute on a rails project

2009-05-13 Thread Colin Law
Accessible to the browser via http at the root of the domain for fetching javascript css etc. Also the 404.html and 500.html error pages are normally there. Also robots.txt etc. Look in your rails project /public folder and you will see what I mean. All of this may have no relevance to adobe

[Rails] Re: Implementing ruby-openid 2.1.6 using TDD

2009-05-13 Thread WJSimacek
On May 13, 9:44 am, Colin Law clan...@googlemail.com wrote: 2009/5/13 WJSimacek wayne.sima...@gmail.com On May 12, 7:55 am, wayne.sima...@gmail.com wayne.sima...@gmail.com wrote: I'm trying to implement ruby-openid 2.1.6 using TDD. Many of the resources I've been using to

[Rails] backgroundrb launched 8 workers via cron which I did not understand

2009-05-13 Thread wbsurf...@yahoo.com
I have a worker my_tree worker as shown in my backgroundrb.yml file below. I played around with the trigger_args setting which I had it calling update_main_tree() every 1 minute. This opens a tree structure in my db that I set and rebuilds it. After it seemed to be working ok, I then set the

[Rails] Re: Implementing ruby-openid 2.1.6 using TDD

2009-05-13 Thread Colin Law
Wayne - sorry I misread your post, I thought you were announcing the tutorial, but I realise now you were quoting someone else. Colin 2009/5/13 WJSimacek wayne.sima...@gmail.com On May 13, 9:44 am, Colin Law clan...@googlemail.com wrote: 2009/5/13 WJSimacek wayne.sima...@gmail.com

[Rails] Re: SocketError (getaddrinfo: Name or service not known)

2009-05-13 Thread daociyiyou
can you help 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-talk@googlegroups.com To unsubscribe from this group, send email to

[Rails] Re: dynamic table names for AR models

2009-05-13 Thread Gabriel Saravia
but for some reason that doesn't quite feel like a good solution. that, overall, makes sense, and is very little code..combine it with a before callback or method_missing? what about it seems like a poor solution? I come back to asking, will all wheel classes have the same attributes and

[Rails] Re: SocketError (getaddrinfo: Name or service not known)

2009-05-13 Thread Tom Z Meinlschmidt
try to set passive mode daociyiyou wrote: hi Tom My ftp directory setting is right.ftp api need port to be specified? I got another error ### Net::FTPPermError (500 Illegal PORT command. ): ### My codes is ### Net::FTP.open('showreelfinder.com') do |ftp|

[Rails] Re: backgroundrb launched 8 workers via cron which I did not understand

2009-05-13 Thread Larz
I noticed that the example in my book has an explicit exit() call at the end of the worker create(). I think that might have something to do with it as when I invoke other methods that create workers, instances of packet_worker_runner seem to hang around. I didn't have such an exit() call in my

[Rails] Re: SocketError (getaddrinfo: Name or service not known)

2009-05-13 Thread daociyiyou
Thank you very much! After changed to passive mode,it works for normal image file.But for thumbnail(binary data),i does not.The ftp api does not support binary data writing? I got the error:No such file or directory On 5月14日, 上午12时13分, Tom Z Meinlschmidt to...@meinlschmidt.org wrote: try to set

[Rails] Tabbed Navigation with Secondary Nav and Auth

2009-05-13 Thread Mark A. Richman
Anyone know of a good tabbed navigation plugin that works with secondary navigation? i.e. http://developer.yahoo.com/ypatterns/examples/tabs.html Ideally, it will integrate with Authlogic. Thanks, Mark --~--~-~--~~~---~--~~ You received this message because you

[Rails] Sharing sessions across rails apps 2.3.2

2009-05-13 Thread Doug Livesey
I've done this in 2.2, but cannot figure it out for 2.3.2: Basically, I want to be able to share session data across a couple of apps. The way I did this in 2.2 was to create a view called sessions in the second app that read the sessions table of the first app. This done, I could tell them both

[Rails] Re: Setting a boolean to false in a before_create callback

2009-05-13 Thread Matt Jones
Does the object pass validation? before_create callbacks won't run if it doesn't. I'd recommend changing the middle line to @assignment.save.should be_true or equivalent to check if the record is getting saved at all. --Matt Jones On May 12, 8:14 pm, Gabriel Saravia

[Rails] Re: MySQL Text type failure

2009-05-13 Thread Matt Jones
Never heard of that happening - can you post a stack track from the log where it gets the 500? --Matt Jones On May 12, 2:09 pm, JannaB mistressja...@hotmail.com wrote: This is very peculiar --  I am using (I am using MySQL 5.0.27- community) If I create a table with the following schema.

[Rails] Re: has_many :through and scopes: how to mutate the set of associated objects?

2009-05-13 Thread Matt Jones
Try it in a named_scope, thus: class Person AR::Base named_scope :as, lambda { |role_name| { :joins = 'CROSS JOIN role_types', :conditions = [(roles.role_type_id = role_types.id) AND role_types.name = ?, role_name] } } end But I'm *almost* positive that that still won't be able to trigger

[Rails] Re: Invalid authenticity token only in IE6

2009-05-13 Thread Andrew
Yes, with some parts of the site, but not at all with the forms I'm having trouble with. On May 12, 7:24 pm, ianneub iann...@gmail.com wrote: We are seeing the same issue, but we're not using the restful- authentication plugin. Are you using jQuery or Prototype at all? On May 3, 8:26 pm,

[Rails] free sms gateway in india

2009-05-13 Thread bramu...@gmail.com
Hi, I am Ramu from India, My rails application needs to have sms feature I searched for couple of rails plugins like sms-fu and all. But it seems that none of them has a support to india mobiles. Please help me in finding out the free sms plugin for rails in india. Thanks, Ramu.

[Rails] Re: Setting a boolean to false in a before_create callback

2009-05-13 Thread Gabriel Saravia
Also, be careful as if a before_create evaluates to false (as your one does) the create won't actually happen. a-ha! thanks to both of you! I had no validations on submitted because I was trying to isolate the problem (but that doesn't mean i didn't want any), but indeed, it was the

[Rails] MVC, best practice for hash that combines objects?

2009-05-13 Thread arcX
Hi, I just wanted to see if I am on the right track, as I am new to MVC. I have a model called Tasks, and another called Entries. Tasks has many entries. Each entry has a time. So I want to total up the time entries so that I have a keyed array of task Ids = duration. In the end, I want to

[Rails] Keep fix data in database table while deploying

2009-05-13 Thread Chris B.
Hi there, I'm pretty new to rails, but so far it's fun! But I couldn't find an answer to solve this problem the rails way: I deploy a webapp using capistrano and everything works fine. In my db I have a table that has some fix entries, like categories, and I want them to move to the

[Rails] Re: Setting a boolean to false in a before_create callback

2009-05-13 Thread Robert Walker
Gabriel Saravia wrote: Also, is it just me because I'm too new, or is the before_validation_on_create callback not talked about enough? As me for me, I set my defaults in the migration (and hence the database) rather than initializing attributes with callbacks. I don't know if that's

[Rails] Re: free sms gateway in india

2009-05-13 Thread Marnen Laibow-Koser
bramu...@gmail.com wrote: Hi, I am Ramu from India, My rails application needs to have sms feature I searched for couple of rails plugins like sms-fu and all. But it seems that none of them has a support to india mobiles. Please help me in finding out the free sms plugin for rails in

[Rails] Re: dynamic table names for AR models

2009-05-13 Thread Marnen Laibow-Koser
Pete Hodgson wrote: Hi All, I have an interesting Active Record problem and I'm not quite sure what the cleanest solution is. The legacy database that I am integrating with has a strange wrinkle in its schema where one logical table has been 'partitioned' into several physical tables. Each

[Rails] Re: What is the sequential steps of installing RoR?

2009-05-13 Thread 7stud --
Sheru Thakuri wrote: Hi, I have installed ruby186-27_rc2 on windows xp for the developement. Now I have questions: - How do I know now the ruby installed successfully Open a command window and at the prompt type: ruby -v and hit Enter/Return. If ruby installed correctly, that command

[Rails] Re: SocketError (getaddrinfo: Name or service not known)

2009-05-13 Thread Tom Z Meinlschmidt
I got the error:No such file or directory it's not problem with binary mode, but with your file :) tom daociyiyou wrote: Thank you very much! After changed to passive mode,it works for normal image file.But for thumbnail(binary data),i does not.The ftp api does not support binary data

[Rails] Re: dynamic table names for AR models

2009-05-13 Thread Pete Hodgson
Gabriel Saravia wrote: but for some reason that doesn't quite feel like a good solution. that, overall, makes sense, and is very little code..combine it with a before callback or method_missing? what about it seems like a poor solution? I come back to asking, will all wheel classes

[Rails] Re: Strange error when running rails 2.3 on ruby 1.9.1 on FreeBSD

2009-05-13 Thread Thomas Webb
If you really want to learn the latest features as a beginner (might not be a good idea just because the complications might leave a bad taste in your mouth when running with rails is generally a smooth process), then I'd suggest doing what I had to do - track edge. The problem you're having

[Rails] Re: dynamic table names for AR models

2009-05-13 Thread Pete Hodgson
Marnen Laibow-Koser wrote: Why not create a wheels view which combines the data from all the wheels_for_* tables, then tie your Wheel model to that? Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org I think that would have some performance issues. If there were 20

[Rails] Re: Sharing sessions across rails apps 2.3.2

2009-05-13 Thread Doug Livesey
That could well be part of it, but I'm afraid I'm not sure I follow you. How would I go about doing that? (I didn't need to with my old approach.) Cheers, Doug. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because

[Rails] Re: Yet Another Time Zone Question

2009-05-13 Thread Randall
Thanks Jeremy! On May 12, 6:31 pm, Jeremy Olliver jeremy.olli...@gmail.com wrote: Hi, The time zone is encoded in the string at the end e.g Mon, 11 May 2009 18:24:37 +1200 Is in a time zone that's +12 (12 hours ahead of utc) DateTime.parse or Time.parse will read this correctly. So what

[Rails] Cucumber + Selenium: Programmatically Starting a Test Server

2009-05-13 Thread Aaron Carlton
Hi All, I am trying to learn BDD using the Cucumber framework, and am integrating Selenium for client side tests. I've been playing with refactoring my cucumber installation a bit, and have pulled the code to start the selenium server out into a profile-configuration file, similar to env.rb: #

[Rails] Re: Keep fix data in database table while deploying

2009-05-13 Thread Chris
Hi Freddy, thanks for the hint, I guess this helps me out. :) At this point, I only set up the db structure in migrations, no data at all. So no data could be transfered to the server... --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] How to kill / abort rails on windows

2009-05-13 Thread guusz
Hi, I have a number of rails servers running on windows as a single service (written in C#) and would like to terminate all processes when the service is stopped. The windows C# way is to use Process.abort(), but it does not seem to kill all processes. Another way is to have a controller

[Rails] Re: Sharing sessions across rails apps 2.3.2

2009-05-13 Thread Frederick Cheung
On May 13, 7:56 pm, Doug Livesey rails-mailing-l...@andreas-s.net wrote: That could well be part of it, but I'm afraid I'm not sure I follow you. How would I go about doing that? (I didn't need to with my old approach.) Ah, we may not be talking about the same thing. Are these apps on

[Rails] Canonical Way/Method to Add/Merge Query Parameters onto URL

2009-05-13 Thread Kendall
Hi, I've done some searching but haven't yet found if there is a correct way to do this. I have an existing URL (generated, for example, by a call to one of my named-route's helpers: login_url). I may (or may not) have, as part of this URL, a query string fragment (?test=true for example) as

[Rails] Re: Sharing sessions across rails apps 2.3.2

2009-05-13 Thread Frederick Cheung
On May 13, 8:56 pm, Doug Livesey rails-mailing-l...@andreas-s.net wrote: They're on the same machine, although I may want to move them at some point. that doesn't quite answer the question - even though they are on the same machine any of the 3 scenarios I mentioned could be in effect. What

[Rails] Re: Canonical Way/Method to Add/Merge Query Parameters onto URL

2009-05-13 Thread Philip Hallstrom
Let's say that your controller gets run with params[:test] = 'true'... Then in your controller or view you can do: login_url(params.merge(:test = false, :foo = 'bar')) and will end up with /login?test=falsefoo=bar Look at the merge and reverse_merge methods for more. -philip On May

[Rails] Re: MVC, best practice for hash that combines objects?

2009-05-13 Thread Colin Law
Assuming you are developing in Rails then the convention would be for the models to be Task and Entry, with the controllers tasks_controller and entries_controller. If I have understood the problem correctly I think the first thing I would do is provide a method in model Task called duration that

[Rails] Setting flash notice via javascript?

2009-05-13 Thread nextpulse
I am using a javascript to redirect to another action. Is there a way to set the flash [:notice] in the javascript? So when the javascript redirects, the new action/view picks up the flash[:notice]? (I suspect I may have to do something like url?notice=.) ideas? thanks.

[Rails] Re: dynamic table names for AR models

2009-05-13 Thread E. Litwin
Also, that view would not be updatable (updateable?) Not sure if that is a requirement but something to be aware of. On May 13, 11:46 am, Pete Hodgson rails-mailing-l...@andreas-s.net wrote: Marnen Laibow-Koser wrote: Why not create a wheels view which combines the data from all the

[Rails] Re: Canonical Way/Method to Add/Merge Query Parameters onto URL

2009-05-13 Thread Kendall
Thanks. Very helpful! On May 13, 2:23 pm, Philip Hallstrom phi...@pjkh.com wrote: Let's say that your controller gets run with params[:test] = 'true'... Then in your controller or view you can do: login_url(params.merge(:test = false, :foo = 'bar')) and will end up with

  1   2   >