[Rails] MapServer setup with rails in ubuntu 12.04
Hi i have one rails application in which i need to setup the mapserver i have added the gem https://github.com/sourcepole/ruby_mapscript but while running the command require rubygems require ruby_mapscript include Mapscript it use to tell me LoadError (cannot load such file -- mapscript): can anybudy help me on this Thanks in Advance Arvind -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2b10546d-ccbd-4b74-9495-c07e71fd38ee%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: MapServer setup with rails in ubuntu 12.04
just add this to the Gemfile gem ruby_mapscript and execute bundle install. Then, You don't need to require it manually When the rails application start, it will require it automatically. 2013년 5월 20일 월요일 오후 4시 22분 34초 UTC+9, Arvind Vyas 님의 말: Hi i have one rails application in which i need to setup the mapserver i have added the gem https://github.com/sourcepole/ruby_mapscript but while running the command require rubygems require ruby_mapscript include Mapscript it use to tell me LoadError (cannot load such file -- mapscript): can anybudy help me on this Thanks in Advance Arvind -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eea1c12f-72be-4af5-89b7-b8a8ddc13e78%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: MapServer setup with rails in ubuntu 12.04
yes i have added it in my gem list inside the rvm , i am working with rails 2.3.5 so i dont have any bundle that what i can not do bundle install. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: MapServer setup with rails in ubuntu 12.04
Even if you add the gem to your system gem path, a rails application doesn't use it. We have to add it to a Gemfile. You can find the Gemfile at the root directory of your rails application. make sure install bundler, before you hit the bundle install. execute this to install bundler gem install bundler 2013/5/20 Arvind Vyas arvindvya...@gmail.com yes i have added it in my gem list inside the rvm , i am working with rails 2.3.5 so i dont have any bundle that what i can not do bundle install. -- You received this message because you are subscribed to a topic in the Google Groups Ruby on Rails: Talk group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/yikR79tv7Fg/unsubscribe?hl=en-US . To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: MapServer setup with rails in ubuntu 12.04
sorry , but it is rails2 application and as i am working since 1 year i did not see any Gemfile on this , my all other gem are working fine but getting problem with this gem only , i do not know weather it has any relation with mapserver or not , because i do not have a mapserver Thanks On Mon, May 20, 2013 at 1:19 PM, 김성식 kssmi...@gmail.com wrote: Even if you add the gem to your system gem path, a rails application doesn't use it. We have to add it to a Gemfile. You can find the Gemfile at the root directory of your rails application. make sure install bundler, before you hit the bundle install. execute this to install bundler gem install bundler 2013/5/20 Arvind Vyas arvindvya...@gmail.com yes i have added it in my gem list inside the rvm , i am working with rails 2.3.5 so i dont have any bundle that what i can not do bundle install. -- You received this message because you are subscribed to a topic in the Google Groups Ruby on Rails: Talk group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/yikR79tv7Fg/unsubscribe?hl=en-US . To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: MapServer setup with rails in ubuntu 12.04
Sorry, Rails2 must be somthing different from 3 or 4. I looked into the ruby_mapscript gem. I ran the test.. then failed. The gem might be broken. 2013/5/20 Arvind Vyas arvindvya...@gmail.com sorry , but it is rails2 application and as i am working since 1 year i did not see any Gemfile on this , my all other gem are working fine but getting problem with this gem only , i do not know weather it has any relation with mapserver or not , because i do not have a mapserver Thanks On Mon, May 20, 2013 at 1:19 PM, 김성식 kssmi...@gmail.com wrote: Even if you add the gem to your system gem path, a rails application doesn't use it. We have to add it to a Gemfile. You can find the Gemfile at the root directory of your rails application. make sure install bundler, before you hit the bundle install. execute this to install bundler gem install bundler 2013/5/20 Arvind Vyas arvindvya...@gmail.com yes i have added it in my gem list inside the rvm , i am working with rails 2.3.5 so i dont have any bundle that what i can not do bundle install. -- You received this message because you are subscribed to a topic in the Google Groups Ruby on Rails: Talk group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/yikR79tv7Fg/unsubscribe?hl=en-US . To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to a topic in the Google Groups Ruby on Rails: Talk group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/yikR79tv7Fg/unsubscribe?hl=en-US . To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: MapServer setup with rails in ubuntu 12.04
Thanks On Mon, May 20, 2013 at 2:01 PM, 김성식 kssmi...@gmail.com wrote: Sorry, Rails2 must be somthing different from 3 or 4. I looked into the ruby_mapscript gem. I ran the test.. then failed. The gem might be broken. 2013/5/20 Arvind Vyas arvindvya...@gmail.com sorry , but it is rails2 application and as i am working since 1 year i did not see any Gemfile on this , my all other gem are working fine but getting problem with this gem only , i do not know weather it has any relation with mapserver or not , because i do not have a mapserver Thanks On Mon, May 20, 2013 at 1:19 PM, 김성식 kssmi...@gmail.com wrote: Even if you add the gem to your system gem path, a rails application doesn't use it. We have to add it to a Gemfile. You can find the Gemfile at the root directory of your rails application. make sure install bundler, before you hit the bundle install. execute this to install bundler gem install bundler 2013/5/20 Arvind Vyas arvindvya...@gmail.com yes i have added it in my gem list inside the rvm , i am working with rails 2.3.5 so i dont have any bundle that what i can not do bundle install. -- You received this message because you are subscribed to a topic in the Google Groups Ruby on Rails: Talk group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/yikR79tv7Fg/unsubscribe?hl=en-US . To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to a topic in the Google Groups Ruby on Rails: Talk group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/yikR79tv7Fg/unsubscribe?hl=en-US . To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Active Admin with Ajax call
Walter I already builded an entire site and also an admin panel with RnR, (with really simple ajax), and i'm doing great stuff with active admin in this current project, the only problem is the ajax. As you said, these tools enforce their own logic on top of Rails, and this is my problem, how to do it with active admin? Maybe i have missed something, and anyway i apreciate your link, and i sure will read it, and do the examples, but if you could explain directly about how to do what i need directly in active admin, i would be really greatful! Thanks so much! On Sunday, May 19, 2013 1:12:45 PM UTC-3, Walter Lee Davis wrote: On May 19, 2013, at 11:36 AM, Walter Lee Davis wrote: On May 17, 2013, at 3:35 PM, Bruno Sapienza wrote: Hello everyone. I'm begining with Ruby on Rails, and i'm facing some trouble with ActiveAdmin with ajax. Here's the situation: It's a Kennel's web site, so, while i'm creating a new dog, i have one select/options for the dog's father, dog's mother, and dog's race. After select the dog's father/mother i can be able to know the race from the dog i'm creating, so i need to dynamically fill the race's option, accordinggly with his father's or mother's race. I know i need a javascript/ajax, and i know hot to do it with php i know it's pretty simple but as i'm new with Ruby on Rails, i don't know where and how to write these codes in active admin. If anyone could help, thanks so much! =) If you're beginning with RoR, I would seriously encourage you to first build an entire site with nothing but the core Rails framework -- no extras at all. I tried using Hobo very early in my Rails career, and I feel like it set me back quite a ways. These engines and meta-frameworks enforce their own logic on top of Rails' and this can cause you to miss some basic concepts that you will need later. Walk then run, IOW. Here's an article that really expands on this idea. http://everydayrails.com/2012/07/31/rails-admin-panel-from-scratch.html You might give it a quick read and see if you agree with my premise. Walter -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com javascript:. To post to this group, send email to rubyonra...@googlegroups.comjavascript:. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/71683f00-e7a9-4e32-bf38-c7f6ad6e31e1%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: Make a column data unique for each user_id
On Saturday, 18 May 2013 11:14:35 UTC-4, Denny Mueller wrote: This is my setup. I have a table user where all user with password and so on are set. The customer table has some customer related data. The user_id is the foreign key to relate the customers to the user. On of the column in the customer table is the customernumber. These numbers has to be uniq for each user_id. class Customers belongs_to :user end class Users has_many :customers end For example. customer | customernumber | user_id 1 00011 2 00021 3 00012 4 00013 5 00023 How can i approach this? Any hints what I have to look for? validates_uniqueness_of has a 'scope' option that will do exactly what you're describing: class Customer ActiveRecord::Base belongs_to :user validates_uniqueness_of :customernumber, :scope = :user_id end Depending on what you're intending to use the customer number for, you may also want to take a look at something like acts_as_list. --Matt Jones -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ddd230c8-db99-40bd-ae18-93145083cb0f%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Active Admin with Ajax call
On May 20, 2013, at 8:40 AM, Bruno Sapienza wrote: Walter I already builded an entire site and also an admin panel with RnR, (with really simple ajax), and i'm doing great stuff with active admin in this current project, the only problem is the ajax. As you said, these tools enforce their own logic on top of Rails, and this is my problem, how to do it with active admin? Maybe i have missed something, and anyway i apreciate your link, and i sure will read it, and do the examples, but if you could explain directly about how to do what i need directly in active admin, i would be really greatful! Thanks so much! I wish I had some snippet I could share here, but I haven't ever used AA so I don't know in how many ways it differs from vanilla Rails in this regard. Have you read the Rails Guides about using the unobtrusive listeners in Rails 3? http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html (Not sure why this isn't listed in the regular guides, but there you go. Just skip the part about TurboLinks since that isn't in Rails 3.x without an extra gem.) Now that gets you the basics of the Rails helpers for unobtrusive JavaScript. The trick in your case will be to figure out how you would structure your request if you weren't using JS, then add the JS response layer over the top of that. What would the URL look like if you were just asking the server to build a picker containing all of the races for the parent? See if you can get the server to return an HTML response containing a single select picker alone in the page. Then make a respond_to option that returns a JSON hash of the options instead, and use your JavaScript to update the options in the second picker. (Don't just replace the second picker, you'll be stuck in a never-ending-loop of having to re-attach your unobtrusive listeners, as they are removed along with the original iteration of that second picker.) Walter On Sunday, May 19, 2013 1:12:45 PM UTC-3, Walter Lee Davis wrote: On May 19, 2013, at 11:36 AM, Walter Lee Davis wrote: On May 17, 2013, at 3:35 PM, Bruno Sapienza wrote: Hello everyone. I'm begining with Ruby on Rails, and i'm facing some trouble with ActiveAdmin with ajax. Here's the situation: It's a Kennel's web site, so, while i'm creating a new dog, i have one select/options for the dog's father, dog's mother, and dog's race. After select the dog's father/mother i can be able to know the race from the dog i'm creating, so i need to dynamically fill the race's option, accordinggly with his father's or mother's race. I know i need a javascript/ajax, and i know hot to do it with php i know it's pretty simple but as i'm new with Ruby on Rails, i don't know where and how to write these codes in active admin. If anyone could help, thanks so much! =) If you're beginning with RoR, I would seriously encourage you to first build an entire site with nothing but the core Rails framework -- no extras at all. I tried using Hobo very early in my Rails career, and I feel like it set me back quite a ways. These engines and meta-frameworks enforce their own logic on top of Rails' and this can cause you to miss some basic concepts that you will need later. Walk then run, IOW. Here's an article that really expands on this idea. http://everydayrails.com/2012/07/31/rails-admin-panel-from-scratch.html You might give it a quick read and see if you agree with my premise. Walter -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com. To post to this group, send email to rubyonra...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/71683f00-e7a9-4e32-bf38-c7f6ad6e31e1%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: acts_as_list crashes with non-numeric id
Greg Willits wrote in post #1109539: Seems to me acts_as_list has a bug -- I have data where the row id is a random alphaNumeric, not a simple integer. Using acts_as_list with a scope of a related model id, acts_as_list crashes the app due to a faulty query in MySQL something like this: class LineItem ActiveRecord::Base belongs_to :order acts_as_list :scope = :order_id end Unknown column 'UXPzIdeIuIFkz6n' in 'where clause': UPDATE `line_items` SET position = (position - 1) WHERE (order_id = UXPzIdeIuIFkz6n AND position 5) I've been trying several ways to force substition to generate those needed quotes myself, but so far no luck. Anyone battle solve this? Thx. For future reference this is one of those times that fighting Rails conventions makes your life more difficult as a Rails developer. Rails wants it simple incrementing integer primary keys. If you can accommodate that wish then life for you as a developer gets simpler. If you want a key that is non-numeric, create a separate column and put a unique constraint on it, but let Rails have its standard simple integer key for use in creating associations. If you really want to fix the problem the I suggest you fork the acts_as_list repository and fix the bug there. My guess is that the author of acts_as_list assumed the Rails conventions and never tested the scenario you've presented here. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b6887584ae6c795286fd8a9f9b14f697%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Active Admin with Ajax call
On May 20, 2013, at 8:40 AM, Bruno Sapienza wrote: Walter I already builded an entire site and also an admin panel with RnR, (with really simple ajax), and i'm doing great stuff with active admin in this current project, the only problem is the ajax. As you said, these tools enforce their own logic on top of Rails, and this is my problem, how to do it with active admin? Maybe i have missed something, and anyway i apreciate your link, and i sure will read it, and do the examples, but if you could explain directly about how to do what i need directly in active admin, i would be really greatful! Thanks so much! Start here: http://www.alfajango.com/blog/rails-3-remote-links-and-forms/ (Just found that in the footer links on the aforelinked Rails Guide.) Walter On Sunday, May 19, 2013 1:12:45 PM UTC-3, Walter Lee Davis wrote: On May 19, 2013, at 11:36 AM, Walter Lee Davis wrote: On May 17, 2013, at 3:35 PM, Bruno Sapienza wrote: Hello everyone. I'm begining with Ruby on Rails, and i'm facing some trouble with ActiveAdmin with ajax. Here's the situation: It's a Kennel's web site, so, while i'm creating a new dog, i have one select/options for the dog's father, dog's mother, and dog's race. After select the dog's father/mother i can be able to know the race from the dog i'm creating, so i need to dynamically fill the race's option, accordinggly with his father's or mother's race. I know i need a javascript/ajax, and i know hot to do it with php i know it's pretty simple but as i'm new with Ruby on Rails, i don't know where and how to write these codes in active admin. If anyone could help, thanks so much! =) If you're beginning with RoR, I would seriously encourage you to first build an entire site with nothing but the core Rails framework -- no extras at all. I tried using Hobo very early in my Rails career, and I feel like it set me back quite a ways. These engines and meta-frameworks enforce their own logic on top of Rails' and this can cause you to miss some basic concepts that you will need later. Walk then run, IOW. Here's an article that really expands on this idea. http://everydayrails.com/2012/07/31/rails-admin-panel-from-scratch.html You might give it a quick read and see if you agree with my premise. Walter -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com. To post to this group, send email to rubyonra...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/71683f00-e7a9-4e32-bf38-c7f6ad6e31e1%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] db connection returns stale values
Hello, I'm working on a rails 3 app for a legacy oracle db. I have a controller that saves object graphs (accepts_nested_attributes_for) but I noticed the post-update JSON response still contains the pre-update values. After some debugging, it appears the database connection is returning stale values (find(), reload(), etc., all return pre-update values; but SQL clients and other ActiveRecord connections find post-update values, confirming the update was written successfully to the database). A call to ActiveRecord::Base.establish_connection fixes the problem for the 'stale' connection. controller: def update #@default_model.update_attributes(params[@model_name]) @default_model.assign_attributes(params[@model_name]) Graph::Helper.save(@default_model) #custom save() for legacy version control debugger @default_model.some_association.updated_field #still shows pre-update value @default_model.reload @default_model.some_association.updated_field #still shows pre-update value @default_model.find(id).some_association.updated_field #still shows pre-update value ActiveRecord::Base.establish_connection(:oracledb); #THIS LINE SEEMS TO FIX THE PROBLEM. @default_model.reload @default_model.some_association.updated_field #shows the correct, updated value. ... end For what it's worth, I'm using jruby in threadsafe mode with the oracle jdbc activerecord adapter. Any suggestions on where to look to get to the bottom of the stale values? Thanks, Tom -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/09d612d5-f35b-4f8d-b9ca-ac214f130bc0%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: acts_as_list crashes with non-numeric id
On Monday, May 20, 2013 2:19:28 PM UTC+1, Ruby-Forum.com User wrote: Greg Willits wrote in post #1109539: Seems to me acts_as_list has a bug -- I have data where the row id is a random alphaNumeric, not a simple integer. Using acts_as_list with a scope of a related model id, acts_as_list crashes the app due to a faulty query in MySQL something like this: class LineItem ActiveRecord::Base belongs_to :order acts_as_list :scope = :order_id end Unknown column 'UXPzIdeIuIFkz6n' in 'where clause': UPDATE `line_items` SET position = (position - 1) WHERE (order_id = UXPzIdeIuIFkz6n AND position 5) I've been trying several ways to force substition to generate those needed quotes myself, but so far no luck. Anyone battle solve this? Thx. For future reference this is one of those times that fighting Rails conventions makes your life more difficult as a Rails developer. Rails wants it simple incrementing integer primary keys. If you can accommodate that wish then life for you as a developer gets simpler. If you want a key that is non-numeric, create a separate column and put a unique constraint on it, but let Rails have its standard simple integer key for use in creating associations. This feels like it should work though - scope is not necessarily a foreign key column (it could easily be a status column for example (open/closed/etc)), so it should work with string valued columns. Also anything which allows an unquoted, user controllable string into an SQL query is a potential security problem Fred -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c4db151e-0b00-46db-a3a7-d4c451abf0e8%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Help needed - No route matches [GET] /draw/load
Hi All, I am new to Rails. I installed rails 3.2.13. Have Ruby ver. 1.9.2p20. I created a very simple rails example as follows. 1. Created rails app called chart 2. Generated a controller called - draw that has the following lines of code. It has a action called load which has no code in it. class DrawController ApplicationController def load end end 3. I then navigated to following directory to create a view template of extension - .rhtml C:\rails\chart\app\views\draw\ 4. I start Webrick and hit URL - http://localhost:3000/draw/load; I get the following error: No route matches [GET] /draw/load Try running rake routes for more information on available routes. The above example is most basic i suppose and should work. The .rhtml page just has plain html. Can someone please tell me what could be the issue. I remember this worked fine with previous rails version. Has anything changed? Help much appreciated. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/79820d7d6ba96117bd1b0b929cc80e44%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: Advice needed --- Best way to get mysql2 gem installed to interact with Mysql Database?
Hassan, My IRC/#rvm session today echoes your advice *to use macports/mysql instead of rvm*. As rvm is just a conduit where the install/compile of gems is outside its jurisdiction regarding correctness. I suggested in the irc/#rvm session that rvm's website be corrected regarding their mysql advice/suggestions. i.e. to use macport instead of rvm to install the mysql2 gem with its appropriate mysql database rather than the dmg route. HTH others like myself. Again thk u Dave The problem with mysql2 still outstanding using the latest mysql.dmg On Monday, May 13, 2013 3:41:30 PM UTC-4, dave wrote: Thks Hassan for your help. I'll try the irc channel though this will be my first experience. Hopefully this will correct the problem. I'll upgrade ruby as suggested Dave On Monday, May 13, 2013 3:23:54 PM UTC-4, Hassan Schroeder wrote: On Mon, May 13, 2013 at 11:29 AM, dave bone_...@mac.com wrote: rvm 1.20.5 (stable) by Wayne E. Seguin , Michal Papis More recent than mine. I would probably ask about that strange warning referencing '/Users/mpapis' on the irc channel. Also, I just realized your Ruby version is pretty old; you might want to try updating that as well (current 1.9.3 MR patchlevel is p392). HTH, and good luck! -- Hassan Schroeder hassan.s...@gmail.com http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1d4914fe-a073-43b9-9091-1272e1f5023a%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: Advice needed --- Best way to get mysql2 gem installed to interact with Mysql Database?
On Mon, May 20, 2013 at 10:29 AM, dave bone_da...@mac.com wrote: My IRC/#rvm session today echoes your advice to use macports/mysql instead of rvm. As rvm is just a conduit where the install/compile of gems is outside its jurisdiction regarding correctness. I suggested in the irc/#rvm session that rvm's website be corrected regarding their mysql advice/suggestions. i.e. to use macport instead of rvm to install the mysql2 gem with its appropriate mysql database rather than the dmg route. Wait, what? I think you're still confused. Using rvm to manage your ruby versions and gemsets has nothing whatsoever to do with how you install server software like MySQL on your system. I suggested that if a MacPorts install of MySQL provided the header files you need to install the mysql *gem* and just worked, then you might as well go with that and be done. So you can get on to the fun part of developing with Rails :-) BTW, do you have a link to the rvm site where it discusses MySQL installation? I've never seen that. -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: Help needed - No route matches [GET] /draw/load
On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: Hi All, I am new to Rails. I installed rails 3.2.13. Have Ruby ver. 1.9.2p20. I created a very simple rails example as follows. 1. Created rails app called chart 2. Generated a controller called - draw that has the following lines of code. It has a action called load which has no code in it. class DrawController ApplicationController def load end end 3. I then navigated to following directory to create a view template of extension - .rhtml C:\rails\chart\app\views\draw\ 4. I start Webrick and hit URL - http://localhost:3000/draw/load; I get the following error: No route matches [GET] /draw/load Try running rake routes for more information on available routes. The above example is most basic i suppose and should work. The .rhtml page just has plain html. Can someone please tell me what could be the issue. I remember this worked fine with previous rails version. Has anything changed? Help much appreciated. -- Posted via http://www.ruby-forum.com/. You need to configure the route in the config/routes.db file. In this case, get 'draw#load' -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/595007db-46ae-4adb-830a-7d7ebba4f687%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: Help needed - No route matches [GET] /draw/load
mike wrote in post #1109637: On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: def load You need to configure the route in the config/routes.db file. In this case, get 'draw#load' Hi Mike. Thanks for response. So in this case i would need to do addition in Routes.rb for each controller/action.? Is there no rule that can be set In routes.rb? -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0619f40ec6aac3e3c353e3c9b45ecc17%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: Help needed - No route matches [GET] /draw/load
On Mon, May 20, 2013 at 12:20 PM, Rochit Sen li...@ruby-forum.com wrote: So in this case i would need to do addition in Routes.rb for each controller/action.? Is there no rule that can be set In routes.rb? Recommended reading: http://guides.rubyonrails.org/routing.html -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: Help needed - No route matches [GET] /draw/load
On 20 May 2013 20:44, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Mon, May 20, 2013 at 12:20 PM, Rochit Sen li...@ruby-forum.com wrote: So in this case i would need to do addition in Routes.rb for each controller/action.? Is there no rule that can be set In routes.rb? Recommended reading: http://guides.rubyonrails.org/routing.html And all the other guides in fact, there are a number of changes since Rails 2. It might be worth skimming through the tutorial at railstutorial.org (which is free to use online) to see how much has changed. Colin -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] activerecord to write to database
I created a db with rake migrate and added to columns, symbol and cur_price in a table call Financials. I want to use activererecord from a script to write the data from the script to the database. Could someone please provide an example. Model: class Financials ActiveRecord::Base attr_accessible :symbol, :cur_price Ruby Script parameters: symbols = [ 'csco,c,bac cur_prices = ['10','20','30'] Thanks in advance -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a9339cf10a91e8e4cce4af596fcec85c%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] undefined method `stringify_keys' for #String:0x007fe8a3ba0a48
From my understanding, you can pass a block to the link_to helper, but the following code gives me an error undefined method `stringify_keys' for #String:0x007fe8a3ba0a48. = link_to(One time Payment with Paypal or Credit Card, @order.payment_payment_standard_url(new_order_url(invoice: @invoice), payment_notifications_url, @invoice)) do = image_tag https://www.paypalobjects.com/webstatic/ mktg/logo/AM_mc_vs_dc_ae.jpg -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b58db872-c5b1-4bea-b7a6-9ec52f856ff6%40r3g2000yqe.googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] activerecord to write to database
On Mon, May 20, 2013 at 3:36 PM, Marcio Pugina li...@ruby-forum.com wrote: I created a db with rake migrate and added to columns, symbol and cur_price in a table call Financials. I want to use activererecord from a script to write the data from the script to the database. Could someone please provide an example. See: rails runner --help -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCGvYYxvF%3DVciL1WFu4r25GRvVugDfZCXndLGcu42U40g%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: acts_as_list crashes with non-numeric id
Robert Walker wrote in post #1109609: For future reference this is one of those times that fighting Rails conventions makes your life more difficult as a Rails developer. I've done quite a few apps with non-numeric IDs w/o problems until now. Apparently I never needed to scope a list (?) or the originall DHH one didn't have this problem maybe? If you really want to fix the problem the I suggest you fork the acts_as_list repository and fix the bug there... hmm... https://github.com/swanandp/acts_as_list/pull/69 So, awareness, but no fix yet. Frederick Cheung wrote in post #1109627: This feels like it should work though - scope is not necessarily a foreign key column (it could easily be a status column for example (open/closed/etc)), so it should work with string valued columns. Also anything which allows an unquoted, user controllable string into an SQL query is a potential security problem That's what I was thinking. Though my (probably incomplete) efforts to inject some quotes have failed. Anyway, I guess I'll hack at my local copy and see what I come up with... Thanks to both -- gw -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7cf3004ae3f9e1656219bb094dba168c%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] gem install rails ERROR
Hi, I am new in mac and ruby on rails, please bear with me if I asked stupid questions : I tried to install, rails in my mac : bdelmajids-iMac:~ majid$ gem install rails ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/1.8 directory. Abdelmajids-iMac:~ majid$ Please your help is appreciated. thanks, -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b769de4a4945f1c0f75f6a7f06643d21%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: Help needed - No route matches [GET] /draw/load
Rochit Sen wrote in post #1109638: mike wrote in post #1109637: On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: def load You need to configure the route in the config/routes.db file. In this case, get 'draw#load' Hi Mike. Thanks for response. So in this case i would need to do addition in Routes.rb for each controller/action.? Is there no rule that can be set In routes.rb? Hi All, I looked at the guide and also entered: get 'draw#load' This is still not working. Can someone please send me a working example or try similar thing themselves. I am really stuck on this. thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/475f527f0547026183df988fa6283950%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Re: Help needed - No route matches [GET] /draw/load
On Tue, May 21, 2013 at 12:01 AM, Rochit Sen li...@ruby-forum.com wrote: Rochit Sen wrote in post #1109638: mike wrote in post #1109637: On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: def load You need to configure the route in the config/routes.db file. In this case, get 'draw#load' Hi Mike. Thanks for response. So in this case i would need to do addition in Routes.rb for each controller/action.? Is there no rule that can be set In routes.rb? Hi All, I looked at the guide and also entered: get 'draw#load' This is still not working. Can someone please send me a working example or try similar thing themselves. I am really stuck on this. Maybe try: match 'draw/load' = 'draw#load' instead? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t9%2B1pn_8FioZFCCRw4hVCHuqDurEWjpw37Ju1UCBDdTbg%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] gem install rails ERROR
On Mon, May 20, 2013 at 10:36 PM, Majid L. li...@ruby-forum.com wrote: Hi, I am new in mac and ruby on rails, please bear with me if I asked stupid questions : I tried to install, rails in my mac : bdelmajids-iMac:~ majid$ gem install rails ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/1.8 directory. Abdelmajids-iMac:~ majid$ Please your help is appreciated. thanks, From the looks of it, you're trying to install rails system-wide with that. If that's what you want, preceed the gem command with sudo. A possibly better alternative is to install either rvm or rbenv, and have things loaded per user or per project. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t9BRMCSdmWf_LhSW7m%2BqG_8mfnaaccb%2BfLMM4C4ZACzVA%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.