0.10 beta I'm a novice at this, so it might be a mistake on my side, but I have added a Paypal Gateway to my production setup, but when I use a valid credit card I receive: Unable to Authorize Credit Card: Gateway Error ... This transaction cannot be processed. Please enter a valid credit card number and type. And in the logs: Processing CheckoutsController#update (for 24.5.69.91 at 2010-03-13 23:35:25) [PUT] Parameters: {"step"=>"confirm", "order_id"=>"R143162781", "action"=>"update", "_method"=>"put", "authenticity_token"=>"-- blanked--", "controller"=>"checkouts"} Gateway Error ... This transaction cannot be processed. Please enter a valid credit card number and type. Rendering template within layouts/spree_application Rendering checkouts/edit Completed in 773ms (View: 42, DB: 66) | 200 OK [https:// fluent.heroku.com/orders/R143162781/checkout] The setup is: Provider: Gateway::PayPal Signature: XXXXXXXXXXXXXXXX Server: Live Test Mode: [ ] (off) Login: jasn_api1.flimage.com Password: XXXXXXXXX Currency Code: Do I have the Serve set correctly? And is the currency code required? Thanks! -Jason -- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
I got it working. Problem was I was editing the wrong copy of spree :embarrassed On Mar 14, 2:41 pm, jeremy nagel <jeremymna...@gmail.com> wrote: > here's the code:http://pastie.org/868627 > > On Mar 13, 11:31 pm, Brian Quinn <br...@railsdog.com> wrote: > > > Yeah I forgot that the Braintree ext was created before the new > > PaymentMethod stuff, so it'll probably not work, my bad. > > > There's no rake task to run, once your class inherits from the Gateway base > > and u call the register method that should do it. > > > Can you post your code and I'll take a look? > > > On 13 March 2010 03:05, jeremy nagel <jeremymna...@gmail.com> wrote: > > > > 1. It's not supported by ActiveMerchant. I wrote a spree gateway class > > > based on the 'Bogus' design. > > > 2. The example you gave apparently doesn't work? "This should be a > > > simple extension to add Braintree to Spree. Unfortunately I can't get > > > it to work." > > > > I added my gateway to the 'gateway_extension' class, which should do > > > the same thing as the extension written for brain-tree (registers it). > > > > Do I need to run a rake class or something like that? > > > > On Mar 13, 1:41 am, Brian Quinn <br...@railsdog.com> wrote: > > > > There's a couple of things you need: > > > > > 1 - Is the gateway you want currently supported by ActiveMerchant? - if > > > not > > > > you'll need to create a patch / override for that. > > > > > 2 - You need to create a wrapper in Spree to wrap around the > > > ActiveMerchant > > > > gateway, take a look athttp://github.com/goodkarma/spree-braintreeforan > > > > example of how to that. > > > > > On 12 March 2010 14:25, jeremy nagel <jeremymna...@gmail.com> wrote: > > > > > > BUMP > > > > > > Can someone please explain to me how I add my gateway to the list in > > > > > the spree admin panel? It is far from self explanatory:( > > > > > > On Mar 8, 6:22 pm, jeremy nagel <jeremymna...@gmail.com> wrote: > > > > > > Hi, > > > > > > I'm trying to create a new gateway for a bank in Australia that > > > > > > performs credit card processing. I've come up against a stumbling > > > > > > block: in order to 'capture' the credit card transaction, the bank > > > > > > wants the credit card details again as well as the pre-auth ID. Is > > > > > > there any way to achieve this? > > > > > > > I'm using Spree Edge and am also finding it a little bit tricky to > > > > > > understand how to add my gateway to the list in the payment methods > > > > > > admin screen. It seems to be hard-coded in but when I added my class > > > > > > to the list in the gateways file, it still didn't appear on the admin > > > > > > screen. > > > > > > -- > > > > > You received this message because you are subscribed to the Google > > > Groups > > > > > "Spree" group. > > > > > To post to this group, send email to spree-user@googlegroups.com. > > > > > To unsubscribe from this group, send email to > > > > > spree-user+unsubscribe@googlegroups.com<spree-user%2Bunsubscribe@googlegroups.com> > > > <spree-user%2Bunsubscribe@googlegroups.com<spree-user%252Bunsubscribe@googlegroups.com> > > > > > > . > > > > > For more options, visit this group at > > > > >http://groups.google.com/group/spree-user?hl=en. > > > > > -- > > > > Brian Quinn > > > > > ------------------------------------------- > > > > Rails Dog LLC > > > > 2 Wisconsin Circle, Suite 700 > > > > Chevy Chase, MD 20815 > > > > voice: (301)560-2000 > > > > ------------------------------------------- > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Spree" group. > > > To post to this group, send email to spree-user@googlegroups.com. > > > To unsubscribe from this group, send email to > > > spree-user+unsubscribe@googlegroups.com<spree-user%2Bunsubscribe@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/spree-user?hl=en. > > > -- > > Brian Quinn > > > ------------------------------------------- > > Rails Dog LLC > > 2 Wisconsin Circle, Suite 700 > > Chevy Chase, MD 20815 > > voice: (301)560-2000 > > ------------------------------------------- -- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
Spree 0.10.0 has been released. Its been several months since the last release so there is even more goodness than usual. Here are some of the highlights * Named scopes and product groups * Pluggable search (with extension support for Xapian, Sphinx and Solr.) * Theming * New and improved multi-step checkout * Improved gateway configuration * Multiple payment methods * Refunds and credits * SEO improvements * Restful API * Support for Rails 2.3.5 and Ruby 1.9 * Please see the release notes for the complete details. I'm especially proud of the support we continue to receive from our awesome community! Checkout the Github compare between this and the last release. * 583 commits * 32 different authors * 1727 files changed I'd like to give a special thanks to our newest core team members: David North and Roman Smirnov. David helped to save the day and finish the massive payment refactoring when I needed to go on a much needed vacation. Roman has been tirelessly applying patches submitted by the community when he was not busy writing his own! Paul Callaghan also deserves a special thanks (welcome back Paul!) Not only has he been very active on the spree-user list, but he spent countless hours making improvements to our documentation. [Cross posted from the Spree Blog] -- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
here's the code: http://pastie.org/868627On Mar 13, 11:31 pm, Brian Quinn <br...@railsdog.com> wrote: > Yeah I forgot that the Braintree ext was created before the new > PaymentMethod stuff, so it'll probably not work, my bad. > > There's no rake task to run, once your class inherits from the Gateway base > and u call the register method that should do it. > > Can you post your code and I'll take a look? > > On 13 March 2010 03:05, jeremy nagel <jeremymna...@gmail.com> wrote: > > > > > 1. It's not supported by ActiveMerchant. I wrote a spree gateway class > > based on the 'Bogus' design. > > 2. The example you gave apparently doesn't work? "This should be a > > simple extension to add Braintree to Spree. Unfortunately I can't get > > it to work." > > > I added my gateway to the 'gateway_extension' class, which should do > > the same thing as the extension written for brain-tree (registers it). > > > Do I need to run a rake class or something like that? > > > On Mar 13, 1:41 am, Brian Quinn <br...@railsdog.com> wrote: > > > There's a couple of things you need: > > > > 1 - Is the gateway you want currently supported by ActiveMerchant? - if > > not > > > you'll need to create a patch / override for that. > > > > 2 - You need to create a wrapper in Spree to wrap around the > > ActiveMerchant > > > gateway, take a look athttp://github.com/goodkarma/spree-braintreeforan > > > example of how to that. > > > > On 12 March 2010 14:25, jeremy nagel <jeremymna...@gmail.com> wrote: > > > > > BUMP > > > > > Can someone please explain to me how I add my gateway to the list in > > > > the spree admin panel? It is far from self explanatory:( > > > > > On Mar 8, 6:22 pm, jeremy nagel <jeremymna...@gmail.com> wrote: > > > > > Hi, > > > > > I'm trying to create a new gateway for a bank in Australia that > > > > > performs credit card processing. I've come up against a stumbling > > > > > block: in order to 'capture' the credit card transaction, the bank > > > > > wants the credit card details again as well as the pre-auth ID. Is > > > > > there any way to achieve this? > > > > > > I'm using Spree Edge and am also finding it a little bit tricky to > > > > > understand how to add my gateway to the list in the payment methods > > > > > admin screen. It seems to be hard-coded in but when I added my class > > > > > to the list in the gateways file, it still didn't appear on the admin > > > > > screen. > > > > > -- > > > > You received this message because you are subscribed to the Google > > Groups > > > > "Spree" group. > > > > To post to this group, send email to spree-user@googlegroups.com. > > > > To unsubscribe from this group, send email to > > > > spree-user+unsubscribe@googlegroups.com<spree-user%2Bunsubscribe@googlegroups.com> > > <spree-user%2Bunsubscribe@googlegroups.com<spree-user%252Bunsubscribe@googlegroups.com> > > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/spree-user?hl=en. > > > > -- > > > Brian Quinn > > > > ------------------------------------------- > > > Rails Dog LLC > > > 2 Wisconsin Circle, Suite 700 > > > Chevy Chase, MD 20815 > > > voice: (301)560-2000 > > > ------------------------------------------- > > > -- > > You received this message because you are subscribed to the Google Groups > > "Spree" group. > > To post to this group, send email to spree-user@googlegroups.com. > > To unsubscribe from this group, send email to > > spree-user+unsubscribe@googlegroups.com<spree-user%2Bunsubscribe@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/spree-user?hl=en. > > -- > Brian Quinn > > ------------------------------------------- > Rails Dog LLC > 2 Wisconsin Circle, Suite 700 > Chevy Chase, MD 20815 > voice: (301)560-2000 > ------------------------------------------- -- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
Philip Hallstrom wrote: > > On Mar 13, 2010, at 9:08 AM, Rajinder Yadav wrote: > >> Hi in my development build using sqlite3, I specified email in my >> Account model to be a unique index as shown below, so why it the db >> happy adding the same emails? this type of insert should fail! >> >> class CreateAccounts < ActiveRecord::Migration >> def self.up >> create_table :accounts do |t| >> t.string :email, :null=>false, :limit=>60 >> t.index :email, :unique=>true >> > > create_table.... > ... > end > > add_index :accounts, :email, :unique => true > > The "t.index" only works for change_table().... Thank Philip for the explanation, this works =) > >> I know about 'validates_uniqueness_of :email', but this check happen >> at the rails level, I wanted also something at the db level. I know >> sqlite3 supports unique indexing, so what's wrong? >> >> -- >> 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, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On Sat, 2010-03-13 at 15:45 -0800, Frederick Cheung wrote: > > On Mar 13, 11:13 pm, RichardOnRails > <RichardDummyMailbox58...@USComputerGurus.com> wrote: > > > > class ChangeExpenseTblAmountCol < ActiveRecord::Migration > > def self.up > > change_column :expense, :amount, :decimal :precision => > > 10, :scale => 2 > > end > > The first parameter is the table name ( ie plural) and you're missing > a comma towards the end. ---- in the thought that give a man a fish and feed him for a day and teach a man to fish, he can feed himself the rest of his life... rake SOME_COMMAND --trace gives you more meaningful output on what went wrong Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
OK, Collin, Thanks to that migrations link you posted last time, I saw another format, the old C-style coding as opposed to the new Rails-DSL- style. Below is the migration code, the db:migration script execution and the results in the database. You don't need to look at all that stuff. I just added to show that the old style does work and pique your curiosity that the new styles don't seem to. Again, Colin, thanks for all your help on this and other programming "hardships". == execution results === • This format works: class ChangeExpenseTblAmountCol < ActiveRecord::Migration def self.up change_column( "expenses", "amount", "decimal(10, 2)" ) end def self.down end end • Apply the migration K:\_Projects\Ruby\_Rails_Apps\_EIMS\RTS>rake db:migrate (in K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS) == ChangeExpenseTblAmountCol: migrating ====================================== -- change_column("expenses", "amount", "decimal(10, 2)") -> 0.7030s == ChangeExpenseTblAmountCol: migrated (0.7190s) ============================= K:\_Projects\Ruby\_Rails_Apps\_EIMS\RTS>
• Testing the database confirms it: mysql> describe expenses; +------------+--------------- | Field | Type +------------+--------------- | id | int(11) | purpose | varchar(255) | vendor | varchar(255) | type | varchar(255) | date | date | amount | decimal(10,2) [snip] -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On Mar 13, 5:01 pm, PierreW < wamre...@googlemail.com> wrote: > Hi guys, > > I am stuck with something, I was hoping someone could point me in the > right direction... > > In short: > - I need to render a bunch of partials (corresponding to models) > - I need to do some DOM logic on them (check if they already exist in > the page, insert them at the right place in the DOM hierarchy, etc) > - I need to do the above first following a standard call, and > subsequently after AJAX ones. > > Right now I have two different methods for each type of call: > - standard: I render the partials inline in the view - it seems fine > and easy > - AJAX: I am trying to use render :update, but the DOM logic becomes > really difficult to write (with a lot of page << > 'javascript_and_prototype_stuff') > > The fact I can't get the same method to work in both cases probably > mean I am missing something. Besides, in the AJAX case, the code > doesn't look very good at all (mixing js logic and Ruby), and it's a > lot more complicated than if I were to write plain javascript. > > Is there a recommended/standard way to do this? > > And as a side question: if I go for a pure javascript implementation, > I am going to miss the convenient render :partial method, isn't it? Or > is there a way to access it from javascript when it's rendered? > You may find things a little easier with a little more actual javascript, eg have your action render the same html fragments but then use the onSuccess/onComplete callbacks (assuming you are using prototype) to sort stuff out clientside (be careful which one you use - Ajax.Updater uses one of these to insert its content, so if you use the wrong one your callback runs before the dom has been updated). I'm not entirely sure what you are doing but you could have your ajax updates appear in a hidden div and move elements out of there into the page. Fred -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On Mar 13, 11:13 pm, RichardOnRails <RichardDummyMailbox58...@USComputerGurus.com> wrote: > > class ChangeExpenseTblAmountCol < ActiveRecord::Migration > def self.up > change_column :expense, :amount, :decimal :precision => > 10, :scale => 2 > end The first parameter is the table name ( ie plural) and you're missing a comma towards the end. Fred -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Hi Colin, Thanks for some additional guidance. I know I appear to be a blithering idiot by virtue of my myriad mistakes, misunderstandings and apparent stupidity. > Why not try it and see? Provided you have a dump of the database (and > you do have your code under source control in git (or svn) don't you) I didn't try it because I have enough trouble going forward. I don't want to again suffer the burden of 2 days to recover from stupid mistakes, like changing MySQL versions as I just did unnecessarily. Dump of DB unnecessary: I only have a little toy data created by testing. SVN backup: I will get to that in a few weeks; right now I make date&time-named backups of my project daily to an external hard-drive: code and documentation. > Did you check the params required for change_column from the docs > (http://api.rubyonrails.org/classes/ActiveRecord/Migration.html)? < It looks to me like you have a missing parameter. Good site, but I didn't find my exact requirement. Yes, I was missing the table-name parm. Here's my current incarnation: class ChangeExpenseTblAmountCol < ActiveRecord::Migration def self.up change_column :expense, :amount, :decimal :precision => 10, :scale => 2 end def self.down end end No matter what permutation I try, the db:migrate task finds an error (usually syntax). When I was in USAF Radio School at the beginning of the Korean "Police Action", I discovered the Cryptographic School next door and "knew" I belonged there. But the effort to crack the code proves I was wrong those many years ago, 'cause I can't crack this code. Does anything leap out at you? As usual, thanks for the gift of your time and expertise, Richard -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Sorry if this is a repost. I never received a successful post msg. So this is my first deployment. I've used Capistrano and Git. CPanel to install all the gems (with some added server support for additional gems). CPanel is used to start/stop the app. In development mode the app starts and runs into a db problem (expected I never copied the sqlite3 db). But it starts. In production mode the mongrel instance never fully loads it looks like it stalling on something to do with authlogic. The mongrel.log shows the following: ** Starting Mongrel listening at 0.0.0.0:12003 ** Starting Rails with production environment... /home/user/rails_apps/myapp/vendor/plugins/paperclip/lib/paperclip.rb: 49: warning: already initialized constant VERSION /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ base.rb:1959:in `method_missing': undefined local variable or method `acts_as_authentic' for #<Class:0xb773bac4> (NameError) from /home/user/rails_apps/myapp/app/models/user.rb:3 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:158:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:265:in `require_or_load' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:224:in `depend_on' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:136:in `require_dependency' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 414:in `load_application_classes' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 413:in `each' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 413:in `load_application_classes' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 411:in `each' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 411:in `load_application_classes' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 197:in `process' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 113:in `send' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 113:in `run' from /home/user/rails_apps/myapp/config/environment.rb:9 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ rails.rb:147:in `rails' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: 113:in `cloaker_' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ configurator.rb:149:in `call' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ configurator.rb:149:in `listener' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: 99:in `cloaker_' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ configurator.rb:50:in `call' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ configurator.rb:50:in `initialize' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: 84:in `new' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: 84:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ command.rb:212:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 from /usr/bin/mongrel_rails:19:in `load' from /usr/bin/mongrel_rails:19 And here is my environment file: RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') ENV['GEM_PATH'] = '/home/user/ruby/gems' $:.push("/home/user/ruby/gems") Rails::Initializer.run do |config| config.gem "authlogic", :version => '2.1.3' config.gem "jeffp- enumerated_attribute", :lib=>"enumerated_attribute" config.gem 'will_paginate', :version => '~> 2.3.12', :source => 'http://gemcutter.org' config.time_zone = 'UTC' end Any ideas why it won't load in production mode? -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Richard, Straight to the point. There are a few ways to get out of this problem, most of them driving you to a MySQL DLL downgrade. IMHO, the fact is MySQL 5.1 doesn't work properly with RoR, so, stick with 5.0, report the problem to MySQL staff and wait for: an official patch for 5.1, or for the 5.2 hoping it will solve the problem. That is it. RichardOnRails wrote: > Hi All, > > "We're sorry, but something went wrong." is the message I got when I > started up an RoR app in the environment: > > Rails 2.3.5 > Ruby 1.8.6 > WinXP-Pro/SP3 > Firefox 3.6 > MySQL 5.0.37-community-nt > Mongrel > > The app under development was working fine until I (stupidly) thought > I needed to upgrade MySQL to 5.1.44. > > I took the precaution of MySQL-dumping > the development db before upgrading. Then I ran into problems which > led me to switch back to a clean install of 5.0.37 and reboot. > > I used MySQL to reinstall the development db and tested it > successfully under the MySQL client. > > I started up Mongrel and ran my app using localhost:3000, getting the > captioned message. > > The development log is presented below. Suggestions are extremely > welcome. > > Thanks in Advance, > Richard > > Development.log > ============ > /!\ FAILSAFE /!\ Fri Mar 12 13:42:10 -0500 2010 > Status: 500 Internal Server Error > Unknown database 'rts_development' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/ > mysql_adapter.rb:589:in `real_connect' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/ > mysql_adapter.rb:589:in `connect' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/ > mysql_adapter.rb:203:in `initialize' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/ > mysql_adapter.rb:75:in `new' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/ > mysql_adapter.rb:75:in `mysql_connection' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:223:in `send' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:223:in `new_connection' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:245:in `checkout_new_connection' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:188:in `checkout' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:184:in `loop' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:184:in `checkout' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/1.8/monitor.rb:242:in > `synchronize' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:183:in `checkout' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:98:in `connection' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:326:in `retrieve_connection' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_specification.rb:123:in `retrieve_connection' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_specification.rb:115:in `connection' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > connection_pool.rb:361:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/head.rb:9:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/methodoverride.rb:24:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in > `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/lock.rb:11:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/lock.rb:11:in `synchronize' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/lock.rb:11:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rails-2.3.5/lib/rails/rack/static.rb:31:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/urlmap.rb:46:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/urlmap.rb:40:in `each' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/urlmap.rb:40:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/content_length.rb:13:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/chunked.rb:15:in `call' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/handler/mongrel.rb:64:in `process' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:159:in `process_client' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in `each' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in `process_client' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `run' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `initialize' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `new' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `run' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `initialize' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `new' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `run' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rack-1.0.1/lib/rack/handler/mongrel.rb:34:in `run' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/ > rails-2.3.5/lib/commands/server.rb:111 > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/site_ruby/1.8/rubygems/ > custom_require.rb:31:in `gem_original_require' > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/site_ruby/1.8/rubygems/ > custom_require.rb:31:in `require' > script/server:3 -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Hi Krum, You didn't say which OS you were interested in... I'm new to RoR (6 months in, so take what want from my comments) and use Aptana Studio, and before I get all the flames from the Rails gurus regarding IDE's over command line tools can I just say that it's because my front end is usually Flex, which, like Aptana is built on Eclipse, so when I was getting started it seemed natural. I like the Aptana IDE because it also provides a very simple way of hooking in to the server. Being new to Rails, and coming from a Windows background, I like the Graphical UI. That said, I have always used the Shell for the usual Ruby/Rails/Rake/ Capistrano commands etc, and only really use Aptana Studio as the editor and nothing more. There is no code hinting to get in the way, but it will tell me if my syntax is wrong (ie unexpected kEND etc) which is really all I need. However, the last six months learning curve has been massive, and I am moving more and more towards the Shell and away from the Windows UI norms........so maybe one day I will shout about textmate or vim to do my editing from the Shell - but not just yet ;) Paul On Mar 12, 10:24 am, Krum Bakalsky <kpym....@gmail.com> wrote: > Hi guys, > > Can you tell me which are the most popular and widely used IDEs for > Ruby, and for Ruby on Rails development ? According to your > impressions ? > What do you use the most ? Are there different solutions for the > different operating systems ? > > Thanks, > > Krum.
-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Is there any way to have one drop-down collection dependent on another within a form? E.g. <% form_for @lab, :html => { :multipart => true } do |f| %> <td><%= f.collection_select :lab_desc_id, LabDesc.find_main, :id, :name %></td> <td><%= f.collection_select :unit_id, LabDesc.units( ??? ), :id, :units %></td> <% end %> So that ??? "knows" the id that was chosen in the first collection_select? Many TIA, Craig -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On Mar 13, 2010, at 9:08 AM, Rajinder Yadav wrote: > Hi in my development build using sqlite3, I specified email in my > Account model to be a unique index as shown below, so why it the db > happy adding the same emails? this type of insert should fail! > > class CreateAccounts < ActiveRecord::Migration > def self.up > create_table :accounts do |t| > t.string :email, :null=>false, :limit=>60 > t.index :email, :unique=>true > create_table.... ... end add_index :accounts, :email, :unique => true The "t.index" only works for change_table().... > I know about 'validates_uniqueness_of :email', but this check happen > at the rails level, I wanted also something at the db level. I know > sqlite3 supports unique indexing, so what's wrong? > > -- > 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, send email to rubyonrails- > talk@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > . >
-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On 13 March 2010 19:35, RichardOnRails < RichardDummyMailbox58407@uscomputergurus.com> wrote: > Hi All, > > I want a migration to change the Amount column of the Expense table to > the precision/scale to 10/2. > > It's easy to say in one sentence. It's a little harder to do. > > 1 Ran: ruby script/generate migration ChangeExpenseTbl_AmountCol > 2.Got db/migrate/20100313180401_change_expense_tbl_amount_col.rb > 3.Modified the migration as follows: > > class ChangeExpenseTblAmountCol < ActiveRecord::Migration > def self.up > class Expense > change_column :amount, decimal :precision=>10, scale=>2 > end > end > > def self.down > end > end > > This looks like it could be DRYed to this: > > class Expense < ActiveRecord::Migration > def self.up > change_column :amount, decimal :precision=>10, scale=>2 > end > > def self.down > end > end > > Do either of these look correct? Why not try it and see? Provided you have a dump of the database (and you do have your code under source control in git (or svn) don't you) then if it messes something up no harm is done. Did you check the params required for change_column from the docs ( http://api.rubyonrails.org/classes/ActiveRecord/Migration.html)? It looks to me like you have a missing parameter. Colin -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On 13 March 2010 18:20, Jorge alejandro Mendoza torres < lists@ruby-forum.com> wrote: > I'm making an application in Ruby, but I create records from text files, > which contain basic information to create a record. Then I modify the > records from the website, but now validating all fields. > What I do is validate some fields when the record is created from the > text file, and then validate the other fields which are filled from the > website. > Here's an example: > > # My Table > Table name: Person > Fields: id, name, address, telephone, mail > > The text file only contains the id and name. From the website, add the > other fields, but I also want to validate. > > So I have the model: > > class Person <ActiveRecord:: Base > validates_presence_of: id > validates_presence_of name Is this what you want? validates_presence_of :somethingelse, :on => :update See the docs for validations at http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html Colin -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Hi, I'm not sure what you mean by "vote", but if it passes testing, then it has my vote. ~Steph > Ok, I see that this worries many people. So I improved behavior: now > when user click on the cart link, order will not create in db. > > @All: See > http://railsdog.lighthouseapp.com/projects/31096-spree/tickets/1238 > and test master branch of edge (0.10.99), and vote for cherry-pick > this to 0.10.0 if you are happy with new behavior. Today is last call. > > On Mar 13, 6:18 am, Sean Schofield <s...@railsdog.com> wrote: >> I agree about the empty carts. If there is a nice patch for this I'm >> open to it. I can't remember offhand why we created the order when >> viewing the empty cart - I suspect it had to do with making things >> REST. To be honest, I wasn't really aware that we were creating empty >> orders when viewing carts - its been a while since I've thought about >> it. >> >> Creating an order for partial checkouts, however, is a feature. The >> data needs to be stored somewhere until the checkout is complete and >> IMO, there is nothing wrong with modeling this as an incomplete order. >> >> Sean Schofield >> >> ------------------------------------------- >> Rails Dog LLC >> 2 Wisconsin Circle, Suite 700 >> Chevy Chase, MD 20815 >> voice: (301)560-2000 >> ------------------------------------------- >> >> On Fri, Mar 12, 2010 at 10:14 PM, Chris <r3ap3r2...@gmail.com> wrote: >> > It's a bug in my book. The number of empty carts doesn't tell me >> > anything. I can possibly see the value of tracking the ones with >> > something in them (especially if it's tied to a user and they have the >> > ability to come back to it later, kind of like a wish list), but plain >> > empty carts in the database = bug. >> >> > The possible exception would be if the user added a product to the >> > cart and then subsequently removed the item. At that point the empty >> > cart does tell me something. But as it currently is, I don't know if >> > someone just clicked the link which auto created an empty cart, or if >> > the user put something in their cart, and then changed their mind. >> >> > My $0.02. >> > +1 for bug >> > -Chris >> >> > On Sat, Mar 13, 2010 at 12:00 PM, <st...@endpoint.com> wrote: >> >> Hi, >> >> >> Will you accept patches for this? >> >> >> First, I think the solution of hiding the cart link when the cart is >> empty >> >> breaks the idea of good usability through consistency. >> >> >> Second, the idea of needing to create a cronjob to address bad data >> is >> >> just silly. The bad data shouldn't be created in the first place. >> >> >> Another note is that the number of empty orders isn't the proper >> >> definition of an abandoned cart. A quick google on "what is abandoned >> >> cart" returned the following definition at >> >>http://multichannelmerchant.com/toolsofthetrade/abandoned_cart/. >> >> "An abandoned cart occurs when a shopper places something in their >> online >> >> shopping cart and then fails to make a purchase during that visit" >> >> >> So, the empty carts stored in the database won't have any information >> >> about the contents that were in the cart when the customer abandoned >> the >> >> site because, well, that cart is empty. There may be other entries in >> the >> >> database of carts with items which are true abandoned carts, but >> combining >> >> the two (full carts / abandoned and empty carts / abandoned) won't >> give >> >> the true abandoned cart rate. Furthermore, analytics should be set up >> to >> >> handle this anyways, in fact, this might be pretty trivial to set up >> with >> >> Google Analytics goal conversion and custom funnels. >> >> >> If I have time at some point, I will look into a patch for this, >> assuming >> >> it's a bug and not a "feature". >> >> >> ~Steph >> >> >>> The idea is to create an order during checkout in case you are >> >>> interested in the number and contents of abandoned orders. Roman is >> >>> correct that you purge them by cron. >> >> >>> Sean Schofield >> >> >>> ------------------------------------------- >> >>> Rails Dog LLC >> >>> 2 Wisconsin Circle, Suite 700 >> >>> Chevy Chase, MD 20815 >> >>> voice: (301)560-2000 >> >>> ------------------------------------------- >> >> >>> On Fri, Mar 12, 2010 at 4:11 PM, Roman Smirnov <pom...@gmail.com> >> wrote: >> >>>>> Any thoughts? >> >> >>>> * Don't show 'Cart' link while cart is empty >> >>>> * Remove old, empty orders by cron >> >> >>>> On Mar 12, 6:12 pm, Sergei <s.n.koz...@gmail.com> wrote: >> >>>>> Hi guys, >> >> >>>>> I encountered a problem that must have been addressed by someone, >> but >> >>>>> I can't find where. I'm a newbie Spree user. >> >> >>>>> Each time someone hits the Cart link, an empty order gets created >> in >> >>>>> the database, which leaves me with hundreds of empty orders a day. >> I >> >>>>> guess that more logical would be actually creating an order at a >> >>>>> checkout, but I may miss something. >> >> >>>>> Any thoughts? >> >> >>>>> Cheers! >> >> >>>>> Sergei >> >>>>> writelesscode.com >> >> >>>> -- >> >>>> You received this message because you are subscribed to the Google >> >>>> Groups "Spree" group. >> >>>> To post to this group, send email to spree-user@googlegroups.com. >> >>>> To unsubscribe from this group, send email to >> >>>> spree-user+unsubscribe@googlegroups.com. >> >>>> For more options, visit this group at >> >>>>http://groups.google.com/group/spree-user?hl=en. >> >> >>> -- >> >>> You received this message because you are subscribed to the Google >> Groups >> >>> "Spree" group. >> >>> To post to this group, send email to spree-user@googlegroups.com. >> >>> To unsubscribe from this group, send email to >> >>> spree-user+unsubscribe@googlegroups.com. >> >>> For more options, visit this group at >> >>>http://groups.google.com/group/spree-user?hl=en. >> >> >> -- >> >> You received this message because you are subscribed to the Google >> Groups "Spree" group. >> >> To post to this group, send email to spree-user@googlegroups.com. >> >> To unsubscribe from this group, send email to >> spree-user+unsubscribe@googlegroups.com. >> >> For more options, visit this group >> athttp://groups.google.com/group/spree-user?hl=en. >> >> > -- >> > You received this message because you are subscribed to the Google >> Groups "Spree" group. >> > To post to this group, send email to spree-user@googlegroups.com. >> > To unsubscribe from this group, send email to >> spree-user+unsubscribe@googlegroups.com. >> > For more options, visit this group >> athttp://groups.google.com/group/spree-user?hl=en. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Spree" group. > To post to this group, send email to spree-user@googlegroups.com. > To unsubscribe from this group, send email to > spree-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/spree-user?hl=en. > >
-- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
Hi Ryan, The contents controller has been in Spree for a while and it was not introduced in the most recent version of Spree. The routes file is read from top to bottom -- if the content controller is first and a path matches a '*path' route, than the contents controller will be called. If your custom taxons controller is first and a path matches '*id', than your taxon controller will be called. What I would probably recommend is writing a custom extension to handle the logic required to either render a taxon or a content page. I've worked on this a big in my forked version of the static_content extension at http://github.com/stephp/spree-static-content. In particular, the logic at http://github.com/stephp/spree-static-content/blob/master/lib/content_controller_override.rb looks for an existing Page that matches the slug (e.g., /about) and renders the view with the Page.find() data, otherwise it renders the path corresponding to the slug (e.g., /my_site would render my_site.html.erb or another erb view). I would recommend you implement something similar, where you lookup an existing taxon and render that view, else you render the fallback content or 404 page. You don't have to do it exactly this way, but IMO this is not a Spree core bug. I would also recommend moving your changes of config/routes.rb to an extension so that you won't have problems merging with core config/routes.rb changes in the future. ~Steph > Hi Guys, > > I've been working on this all of today by breaking the upgrade down > step-by-step. It seems that tha actual problem lays within the routes > file. > > As part of my seo strategy I have changed the nested_taxon in the > routes.rb file and removed the front '/t' as follows: > # route globbing for pretty nested taxon and product paths > map.nested_taxons '/*id', :controller => 'taxons', :action => 'show' > > This seems to be causing some conflict with the new route that was > added in the lastest spree at the bottom of the routes file: > # a catchall route for "static" content > map.connect '*path', :controller => 'content', :action => 'show' > > If I move the nested_taxons above the admin name space and map.connect > '*path' then the nested_taxons works fine on the front end, and the > admin pages don't display correctly. Whilst if I put the map.connect > '*path' closer to the top of the routes file then the admin section > displays correctly and the nested_taxons don't. > > I'm really out of ideas on how to fix this so if any of the Spree core > team or anyone who can come up with a solution I would greatly > appreciate it. > > > Thanks, > Ryan > > Here is the full routes file I have so far... > > ActionController::Routing::Routes.draw do |map| > > # Loads all extension routes in the order they are specified. > map.load_extension_routes > > map.root :controller => "homepage", :action => "index" > > map.resource :user_session, :member => {:nav_bar => :get} > map.resource :account, :controller => "users" > map.resources :password_resets > > # login mappings should appear before all others > map.login '/login', :controller => 'user_sessions', :action => 'new' > map.logout '/logout', :controller => 'user_sessions', :action => > 'destroy' > map.signup '/signup', :controller => 'users', :action => 'new' > map.admin '/admin', :controller => 'admin/overview', :action => > 'index' > > map.resources :tax_categories > map.resources :countries, :has_many => :states, :only => :index > map.resources :states, :only => :index > map.resources :users > map.resources :products, :member => {:change_image => :post} > map.resources :orders, :member => {:address_info => :get}, :has_many > => [:line_items, :creditcards, :creditcard_payments] > map.resources :orders, :member => {:fatal_shipping => :get} do | > order| > order.resources :shipments, :member => {:shipping_method => :get} > order.resource :checkout, :member => {:register => :any} > end > #map.resources :shipments, :member => {:shipping_method => :any} > > # Search routes > map.simple_search '/s/*product_group_query', :controller => > 'products', :action => 'index' > map.pg_search '/pg/:product_group_name', :controller => > 'products', :action => 'index' > > > # a catchall route for "static" content > map.connect '/web/*path', :controller => 'content', :action => > 'show' > > map.taxons_search '/*id/s/*product_group_query', { > :controller => 'taxons', > :action => 'show' > } > map.taxons_pg_search '/*id/pg/:product_group_name', { > :controller => 'taxons', > :action => 'show' > } > > map.resources :taxons > > # route globbing for pretty nested taxon and product paths > > map.nested_taxons '/*id', :controller => 'taxons', :action => 'show' > > #map.connect '*path', :controller => 'content', :action => 'show' > map.namespace :admin do |admin| > admin.resources :coupons > admin.resources :zones > admin.resources :users > admin.resources :countries, :has_many => :states > admin.resources :states > admin.resources :tax_categories > admin.resources :configurations > admin.resources :products, :member => {:clone => :get}, :has_many > => [:product_properties, :images] do |product| > product.resources :variants > product.resources :option_types, :member => { :select > => :get, :remove => :get}, :collection => {:available > => :get, :selected => :get} > product.resources :taxons, :member => {:select => :post, :remove > => :post}, :collection => {:available => :post, :selected => :get} > end > admin.resources :option_types > admin.resources :properties, :collection => {:filtered => :get} > admin.resources :prototypes, :member => {:select > => :post}, :collection => {:available => :get} > admin.resource :mail_settings > admin.resource :inventory_settings > admin.resources :google_analytics > admin.resources :orders, :has_many => > [:adjustments, :line_items], :has_one => :checkout, :member => {:fire > => :put, :resend => :post, :history => :get} do |order| > order.resources :shipments, :member => {:fire => :put} > order.resources :return_authorizations, :member => {:fire > => :put} > end > admin.resources :orders do |order| > order.resources :payments, :member => {:fire => :put, :finalize > => :put} > end > admin.resource :general_settings > admin.resources :taxonomies, :member => { :get_children => :get } > do |taxonomy| > taxonomy.resources :taxons > end > admin.resources :reports, :only => [:index, :show], :collection => > {:sales_total => :get} > > admin.resources :shipments > admin.resources :shipping_methods > admin.resources :shipping_categories > admin.resources :shipping_rates > admin.resources :tax_rates > admin.resource :tax_settings > admin.resources :calculators > admin.resources :product_groups, :has_many => :product_scopes > admin.resources :trackers > admin.resources :payment_methods > end > > map.connect ':controller/:action/:id.:format' > map.connect ':controller/:action/:id' > > # a catchall route for "static" content > map.connect '*path', :controller => 'content', :action => 'show' > > end > > -- > You received this message because you are subscribed to the Google Groups > "Spree" group. > To post to this group, send email to spree-user@googlegroups.com. > To unsubscribe from this group, send email to > spree-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/spree-user?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
Hi Guys, I've been working on this all of today by breaking the upgrade down step-by-step. It seems that tha actual problem lays within the routes file. As part of my seo strategy I have changed the nested_taxon in the routes.rb file and removed the front '/t' as follows: # route globbing for pretty nested taxon and product paths map.nested_taxons '/*id', :controller => 'taxons', :action => 'show' This seems to be causing some conflict with the new route that was added in the lastest spree at the bottom of the routes file: # a catchall route for "static" content map.connect '*path', :controller => 'content', :action => 'show' If I move the nested_taxons above the admin name space and map.connect '*path' then the nested_taxons works fine on the front end, and the admin pages don't display correctly. Whilst if I put the map.connect '*path' closer to the top of the routes file then the admin section displays correctly and the nested_taxons don't. I'm really out of ideas on how to fix this so if any of the Spree core team or anyone who can come up with a solution I would greatly appreciate it. Thanks, Ryan
Here is the full routes file I have so far... ActionController::Routing::Routes.draw do |map| # Loads all extension routes in the order they are specified. map.load_extension_routes map.root :controller => "homepage", :action => "index" map.resource :user_session, :member => {:nav_bar => :get} map.resource :account, :controller => "users" map.resources :password_resets # login mappings should appear before all others map.login '/login', :controller => 'user_sessions', :action => 'new' map.logout '/logout', :controller => 'user_sessions', :action => 'destroy' map.signup '/signup', :controller => 'users', :action => 'new' map.admin '/admin', :controller => 'admin/overview', :action => 'index' map.resources :tax_categories map.resources :countries, :has_many => :states, :only => :index map.resources :states, :only => :index map.resources :users map.resources :products, :member => {:change_image => :post} map.resources :orders, :member => {:address_info => :get}, :has_many => [:line_items, :creditcards, :creditcard_payments] map.resources :orders, :member => {:fatal_shipping => :get} do | order| order.resources :shipments, :member => {:shipping_method => :get} order.resource :checkout, :member => {:register => :any} end #map.resources :shipments, :member => {:shipping_method => :any} # Search routes map.simple_search '/s/*product_group_query', :controller => 'products', :action => 'index' map.pg_search '/pg/:product_group_name', :controller => 'products', :action => 'index' # a catchall route for "static" content map.connect '/web/*path', :controller => 'content', :action => 'show'
map.taxons_search '/*id/s/*product_group_query', { :controller => 'taxons', :action => 'show' } map.taxons_pg_search '/*id/pg/:product_group_name', { :controller => 'taxons', :action => 'show' } map.resources :taxons # route globbing for pretty nested taxon and product paths map.nested_taxons '/*id', :controller => 'taxons', :action => 'show' #map.connect '*path', :controller => 'content', :action => 'show' map.namespace :admin do |admin| admin.resources :coupons admin.resources :zones admin.resources :users admin.resources :countries, :has_many => :states admin.resources :states admin.resources :tax_categories admin.resources :configurations admin.resources :products, :member => {:clone => :get}, :has_many => [:product_properties, :images] do |product| product.resources :variants product.resources :option_types, :member => { :select => :get, :remove => :get}, :collection => {:available => :get, :selected => :get} product.resources :taxons, :member => {:select => :post, :remove => :post}, :collection => {:available => :post, :selected => :get} end admin.resources :option_types admin.resources :properties, :collection => {:filtered => :get} admin.resources :prototypes, :member => {:select => :post}, :collection => {:available => :get} admin.resource :mail_settings admin.resource :inventory_settings admin.resources :google_analytics admin.resources :orders, :has_many => [:adjustments, :line_items], :has_one => :checkout, :member => {:fire => :put, :resend => :post, :history => :get} do |order| order.resources :shipments, :member => {:fire => :put} order.resources :return_authorizations, :member => {:fire => :put} end admin.resources :orders do |order| order.resources :payments, :member => {:fire => :put, :finalize => :put} end admin.resource :general_settings admin.resources :taxonomies, :member => { :get_children => :get } do |taxonomy| taxonomy.resources :taxons end admin.resources :reports, :only => [:index, :show], :collection => {:sales_total => :get} admin.resources :shipments admin.resources :shipping_methods admin.resources :shipping_categories admin.resources :shipping_rates admin.resources :tax_rates admin.resource :tax_settings admin.resources :calculators admin.resources :product_groups, :has_many => :product_scopes admin.resources :trackers admin.resources :payment_methods end map.connect ':controller/:action/:id.:format' map.connect ':controller/:action/:id' # a catchall route for "static" content map.connect '*path', :controller => 'content', :action => 'show' end -- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
On 13 March 2010 19:20, Milan Dobrota < lists@ruby-forum.com> wrote: > In this case I have before create hooks in place to fill in some > attributes. If you trim the whole of the email you're replying too, we lose all sense of context.... Anyway... a simple solution is to have a method add a new comment if the comments array is empty, and then send the call that you pass to the array (so you can use any Array method as a parameter). More complex solutions would be to patch AR::Base or maybe Array to do a similar thing. # in your Post model def find_or_create_comment(which) Post.comments << Comment.create if Post.comments.blank? Post.comments.send(which.to_s) if Post.comments.respond_to?(which.to_s) end That's off the top of my head so it is probably buggy, but might put you on the tail of something that suits - it relies on the "create" method actually working, so if the Comment fails validation, it will break big time. I think better solutions might be suggested if you describe the problem that you have that you want to use this as a solution to... Regards, -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Hi All, I want a migration to change the Amount column of the Expense table to the precision/scale to 10/2. It's easy to say in one sentence. It's a little harder to do. 1 Ran: ruby script/generate migration ChangeExpenseTbl_AmountCol 2.Got db/migrate/20100313180401_change_expense_tbl_amount_col.rb 3.Modified the migration as follows: class ChangeExpenseTblAmountCol < ActiveRecord::Migration def self.up class Expense change_column :amount, decimal :precision=>10, scale=>2 end end def self.down end end This looks like it could be DRYed to this: class Expense < ActiveRecord::Migration def self.up change_column :amount, decimal :precision=>10, scale=>2 end def self.down end end Do either of these look correct? Thanks in Advance, Richard -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
I have the Active_shipping extension running and communicating with UPS. When I add a product to the cart, and checkout the shipping calculates fine. If I leave the cart, add another product, the shipping costs never change. The total order costs does reflect the change but shipping costs remain the same. It seems like this is an issue with Line Items or Active Shipping. Has anyone else seen this? If so how did you fix. I am running 0.9.4, and this is the last item before the site is ready to launch... Thanks so much in advance for the help. TJ -- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
I've got the entire application back to where I was before I thought upgrading MySQL might be the solution to my problem. The problem was that I added an expense item which included an amount, say 10.50. After saving the new item, the expense amount displayed as simply 10 -- no .50 anywhere. I finally realized my problem was scale=0 for my amount column. I generated/edited this migration to fix my problem. Do you think it will work if I use rake to apply it? class ChangeExpenseTblAmountCol < ActiveRecord::Migration def self.up class Expense change_column :amount, decimal :precision=>10, scale=>2 end end def self.down end end Or should I have simply changed the class name (which is simply the name I gave to the generator). I'm running Rails 2.3.5, Ruby 1.8.6 and MySQL 5.0.37-community-nt On Mar 13, 2:27 am, kannav rajeev <rajeevsharm...@gmail.com> wrote: > Check out yours database and table is they are fine ? > and if possible rebuilt app > or > reconfigure database.yml > > thanks its about database connectivity issue i think > > -- > > Thanks: > Rajeev sharma
-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Do you know any Chatroulette Clone using Ruby on Rails? This clone: http://www.camcarousel.com/ is not. If you haven't heard of Chatroulette. Read about this Internet sensation: http://en.wikipedia.org/wiki/Chatroulette . Thanks. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Already there was a discussion on same topic few days back in the community.. just google before you post any ;) IDE Discussion Best Wishes, Saideep Annadatha -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
I'm making an application in Ruby, but I create records from text files, which contain basic information to create a record. Then I modify the records from the website, but now validating all fields. What I do is validate some fields when the record is created from the text file, and then validate the other fields which are filled from the website. Here's an example: # My Table Table name: Person Fields: id, name, address, telephone, mail The text file only contains the id and name. From the website, add the other fields, but I also want to validate. So I have the model: class Person <ActiveRecord:: Base validates_presence_of: id validates_presence_of name end How can I make previous validation from the 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 rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Hi Joel,
Thanks for the plugin ! I would like to use it but i am working on ubuntu machine and textmate works with mac. meanwhile i found rails.vim script for vim that solved my auto indentation problems.
On Mon, Nov 2, 2009 at 1:32 AM, Joel Chippindale <rails-mailing-list@andreas-s.net> wrote: I've written a Textmate plugin that indents Ruby code (rather better than Textmate does on it's own but not as well as Netbeans which, as mentioned earlier in the thread does a great job). It's all written in Ruby so would be easy enough to extract into a gem (it's on my to do list). You can see it all here http://github.com/mocoso/code-beautifier.tmbundle If anyone's interested in using a gem based on this then say (and maybe that'll poke me to get it done). J. -- Posted via http://www.ruby-forum.com/.
-- Sandip --- www.funonrails.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 group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
|