[Rails] Re: Metaprogramming Q: Calling an external class method on after_save

2014-11-13 Thread Debajit Adhikary
(In the final code sample, the error I get is: NameError (undefined local variable or method `award_callback' for #): On Thursday, November 13, 2014 8:37:40 PM UTC-8, Debajit Adhikary wrote: > > I have the following classes: > > class AwardBase > class AwardOne < AwardBase > class

[Rails] Metaprogramming Q: Calling an external class method on after_save

2014-11-13 Thread Debajit Adhikary
I have the following classes: class AwardBase class AwardOne < AwardBase class Post < ActiveRecord::Base The Post is an ActiveRecord, and the Award has a can_award? class method which takes a post object and checks to see if it meets some criteria. If yes, it updates post.owner.awar

[Rails] How to generate database.yml

2014-11-13 Thread Kengsreng Tang
I generate new rails application with --skip-activerecord, because I'm going to use with MongoDB. But right now I want my APP to support MySQL as well. Any solutions? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on

Re: [Rails] Re: Remote Junior Ruby on Rails Developer

2014-11-13 Thread Evaldo Santos
I'm too from Brazil, looking for a remote job paid or no. On Wed, Nov 12, 2014 at 2:35 PM, destiny labs wrote: > remote job? > I´m living in Brazil > > 2014-11-12 13:46 GMT-02:00 Yarik Nelin : > > Hello guys. >> >> If anyone want a junior RoR developer in your team I would like to work >> with y

Re: [Rails] Using Migrations to load user data?

2014-11-13 Thread Colin Law
On 13 November 2014 18:44, wrote: > @rails Hi, > > I'm new to rails, and my dev team wants to load all user content data (not > reference data or admin users) via migrations. Is this going to be > problematic? > > If so, how can I convince them that is a likely mistake? What would be the > altern

[Rails] Using Migrations to load user data?

2014-11-13 Thread bob . n . bah3
@rails Hi, I'm new to rails, and my dev team wants to load all user content data (not reference data or admin users) via migrations. Is this going to be problematic? If so, how can I convince them that is a likely mistake? What would be the alternatives? Thanks, B

Re: [Rails] Re: Remote Junior Ruby on Rails Developer

2014-11-13 Thread destiny labs
remote job? I´m living in Brazil 2014-11-12 13:46 GMT-02:00 Yarik Nelin : > Hello guys. > > If anyone want a junior RoR developer in your team I would like to work > with you. > > Thank's. > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribe

[Rails] Heroku article on creating a direct to S3 upload

2014-11-13 Thread Christopher Tauer
Hello all, I followed the Heroku article on creating a Direct to S3 file uploader for my Rails app. https://devcenter.heroku.com/articles/direct-to-s3-image-uploads-in-rails I think that I did everything the tutorial said... In my users_controller, under *new* is: @s3_direct_post = S3_BU

Re: [Rails] Re: SortHelper combined columns

2014-11-13 Thread Colin Law
On 13 November 2014 17:35, Zdravko Balorda wrote: > I use SortHelper which provides for sorting by any column of the table. > With patient name I would like to have only one column. The combined > column could be 'name' as in: > select ..., lastname||', '||firstname as name from patients... order

[Rails] Re: SortHelper combined columns

2014-11-13 Thread Zdravko Balorda
I use SortHelper which provides for sorting by any column of the table. With patient name I would like to have only one column. The combined column could be 'name' as in: select ..., lastname||', '||firstname as name from patients... order by name This column does not appear in the table itself.

Re: [Rails] heroku not supporting website from othr web source..

2014-11-13 Thread Jason Fleetwood-Boldt
Did you set the CORS on the domain that is serving up the assets? Your problem almost certainly has nothing to do with Heroku. http://en.wikipedia.org/wiki/Cross-origin_resource_sharing http://en.wikipedia.org/wiki/Same-origin_policy On Nov 13, 2014, at 7:28 AM, Matt Jones wrote: > > >

[Rails] image resize

2014-11-13 Thread aldm alert
Hi, I'm using minimagick gem 3.8.0 version. I was having imagemagick 6.8.9-0 and resizing images worked ok with imagemagick. But after upgrading imagemagick on version to 6.8.9-7 uploading some images won't resize with this error: Corrupt JPEG data: 1712 extraneous bytes before marker 0xd9 Is th

Re: [Rails] Re: Ruby - Iterating over a Nested Hash

2014-11-13 Thread Vivek Sampara
You will have to use nokogiri gem to parse it and iterate. More details here. http://www.nokogiri.org/tutorials/parsing_an_html_xml_document.html On Thu, Nov 13, 2014 at 8:12 PM, Scott Bradford wrote: > I am trying to build it nearly like the PHP example above. > > I'll build the header row fo

Re: [Rails] SortHelper combined columns

2014-11-13 Thread Colin Law
On 13 November 2014 15:30, Zdravko Balorda wrote: > Hi, > I'd like to sort table of patiens with lastname, firstname in the same > column. > Of course in the model Patient there are two columns, which I need > joined while sortable. > Is there any way to do that with SortHelper? Can you be more

[Rails] SortHelper combined columns

2014-11-13 Thread Zdravko Balorda
Hi, I'd like to sort table of patiens with lastname, firstname in the same column. Of course in the model Patient there are two columns, which I need joined while sortable. Is there any way to do that with SortHelper? Regards, Zdravko -- Posted via http://www.ruby-forum.com/. -- You received t

[Rails] Re: Ruby - Iterating over a Nested Hash

2014-11-13 Thread Scott Bradford
I am trying to build it nearly like the PHP example above. I'll build the header row for a table and then run the loop to fill the cells and then put in a closer for the table. Here is a sample of the data: 2970 Best Buy Mobile - Brunswick Square Mall 598 East Brunswick

Re: [Rails] Ruby - Iterating over a Nested Hash

2014-11-13 Thread Vivek Sampara
If you want to iterate over each nested hash - it totally depends on the depth of the hash and the kind of view you're trying to build using it. If you dont have knowledge about the other keys that come in the hash, use this pattern. h = { "a" => 100, "b" => 200 }h.each {|key, value| puts "#{key}

[Rails] Ruby - Iterating over a Nested Hash

2014-11-13 Thread Scott Bradford
I am trying to figure out how to output a global variable to my view page to EACH DO loop the contents of my xml file. This is how my controller is configured: ** CONTROLLER CLASS ** require 'net/http' require 'httparty' require 'rexml/document' require 'uri' require 'remixr' include R

[Rails] Rails4 - How to design model to save multiple items for a table's column?

2014-11-13 Thread James Davis, PhD
For this situation, you should have User, Language, and UserLanguage models. User :has_many user_languages and :has_many languages :through user_languages. Take a look at Ryan Bates' webcast http://railscasts.com/episodes/17-habtm-checkboxes-revised. It is a bit old but still applies to your

[Rails] Re: heroku not supporting website from othr web source..

2014-11-13 Thread Matt Jones
On Thursday, 13 November 2014 02:35:42 UTC-5, mukul saharia wrote: > > hello friends, > i am working with rails and i want to load some java script components > from other web source and render it in my web site which is hosted on > heroku. > but heroku is not loading components from other web

[Rails] Rails4 - How to design model to save multiple items for a table's column?

2014-11-13 Thread Suresh Kumar
I have a user model with name, email and password. Now I want to add languages know by the user to the user model. I can do that by the following rails generate migration add_languagesknown_to_users languagesknown:string But I want the user to have the capability to store multiple languages. So

[Rails] Re: Rails4 - How to receive and send JSON data securely through Ajax and store it?

2014-11-13 Thread Suresh Kumar
Hey Frederick Cheung thanks for the reply. I removed "skip_before_filter :verify_authenticity_token" and I sent authenticity token as parameter and it worked. :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rail

Re: [Rails] Refill a form when invalid data is submitted

2014-11-13 Thread Walther Diechmann
please allow me to elaborate on Colin’s reply: Colin is - if you trace the archives - one of this maillists most helpful and you will have to look hard to find him ‘sending off people’ that infact to put in the hours. It is a trend in society that you ‘show off’ from the get go, only to realize

Re: [Rails] Re: Refill a form when invalid data is submitted

2014-11-13 Thread Vivek Sampara
Such an excellent answer ! On Thu, Nov 13, 2014 at 1:55 PM, Colin Law wrote: > On 13 November 2014 01:10, Andrew Gimma wrote: > > I don't know why people are generally so unhelpful on these message > > boards. I've been a professional programmer for years, and I've seen so > > many people turne

Re: [Rails] Re: Refill a form when invalid data is submitted

2014-11-13 Thread Colin Law
On 13 November 2014 01:10, Andrew Gimma wrote: > I don't know why people are generally so unhelpful on these message > boards. I've been a professional programmer for years, and I've seen so > many people turned away because people just say "go read an entire book > for this one simple problem" ra