[Rails] how to use before_filter to decrypt post data

2013-02-27 Thread ε“δΈ€ζŠ—
hello, everybody. in ror, we can add a after_filter to a controller. def aes_encrypt response.body = AesHelper.aes_encrypt(response.body) end after_filter :aes_encrypt and all action's repsonse int the controller can be encrypt. and my question is , how to decrypt data use before_fil

[Rails] autocomplete search terms question

2013-02-27 Thread William Pramana
Hi, I just read the tutorial on autocomplete search terms - http://railscasts.com/episodes/399-autocomplete-search-terms. My question is, how do I enable linking to the search result so people can click and go to the item permanent link. Thanks, William -- You received this message becaus

[Rails] RoR on IDE for Beginner

2013-02-27 Thread Stewart Alsop
Should I use an IDE for beginning with Rails? -- 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 th

[Rails] Rake tasks db:test:prepare cannot be executed in the same task of db:reset or db:migrate

2013-02-27 Thread Rafael Sales
Hey all, I'm trying to create a task that prepare the environment to start programming. To do so, I created a task like this *task :setup_env => ['db:reset', 'db:migrate', 'db:test:prepare']* and observed that after execute * rake setup_env*, it never execute db:test:prepare properly. In order to

[Rails] Re: TicketType Expected, Got String

2013-02-27 Thread Colton Pl
That worked perfectly. Thanks alot for the help, and ill keep the line #'s in mind for next time -- 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 receivin

Re: [Rails] TicketType Expected, Got String

2013-02-27 Thread Colin Law
On 27 February 2013 19:56, Colton Pl wrote: > TicketType(#70316537311800) expected, got String(#10085740) > > app/controllers/reasons_controller.rb:44:in `new' > app/controllers/reasons_controller.rb:44:in `create' > > View: > > <%= f.label :ticket_type %> > <%= f.select :ticket_type, TicketType.a

Re: [Rails] can't config profile page to update data forms and save

2013-02-27 Thread Colin Law
On 27 February 2013 16:40, C Wilson wrote: > I am new to Rails Have you worked right through a good Rails tutorial such as railstutorial.org in order to understand the basics of Rails? If not then do that first. If you have already done that then have a look at the Rails Guide on debugging whic

[Rails] [ANN] Rails 3.2.13.rc1 has been released!

2013-02-27 Thread Steve Klabnik
Hey everyone! I am pumped to announce that Rails 3.2.13.rc1 has been released! If no regressions are found I will release 3.2.13 final in two weeks, on March 13, 2013. If you find one, please [Open an Issue on GitHub](https://github.com/rails/rails/issues/new) so that I can fix it before the final

[Rails] can't config profile page to update data forms and save

2013-02-27 Thread C Wilson
I am new to Rails and I am setting up the user profile and adding fields to it for users to add details to their profile such as career, about me, height, religion, etc. This information is completely different from the registration options (account settings). As of now the profile fields are b

[Rails] TicketType Expected, Got String

2013-02-27 Thread Colton Pl
TicketType(#70316537311800) expected, got String(#10085740) app/controllers/reasons_controller.rb:44:in `new' app/controllers/reasons_controller.rb:44:in `create' View: <%= f.label :ticket_type %> <%= f.select :ticket_type, TicketType.all.collect {|t| [ t.description, t.description]}, {:include_

Re: [Rails] ActiveRecord newbie question

2013-02-27 Thread Colin Law
On 27 February 2013 14:51, Rahul Sharma wrote: > Hi Guys, > > I have a standalone ruby testing framework without rails testing some > webservices. The project uses ActiveRecord to connect to mysql remote > database through mysql adapter and uses very basic Activerecord features > only like "establ

[Rails] ActiveRecord newbie question

2013-02-27 Thread Rahul Sharma
Hi Guys, I have a standalone ruby testing framework without rails testing some webservices. The project uses ActiveRecord to connect to mysql remote database through mysql adapter and uses very basic Activerecord features only like "establish_connection" and inserting values in a table. The mod

Re: [Rails] Creating array, decimal

2013-02-27 Thread Colin Law
On 27 February 2013 15:11, Werner Laude wrote: > > Am 27.02.2013 um 16:05 schrieb Colin Law : > >> On 27 February 2013 12:23, Werner wrote: >>> Hi >>> I have an attribute decimal => hour >>> >>> If I do >>> >>> hours.each do |h| >>> h.my_hour >>> end >>> I get => 20.0 0.0 0.0 10.0 >>> >>> An

Re: [Rails] Creating array, decimal

2013-02-27 Thread Werner Laude
Am 27.02.2013 um 16:05 schrieb Colin Law : > On 27 February 2013 12:23, Werner wrote: >> Hi >> I have an attribute decimal => hour >> >> If I do >> >> hours.each do |h| >> h.my_hour >> end >> I get => 20.0 0.0 0.0 10.0 >> >> And this.. >> myhour = [] >> hours.each do |h| >> myhour << hou

Re: [Rails] Creating array, decimal

2013-02-27 Thread Colin Law
On 27 February 2013 12:23, Werner wrote: > Hi > I have an attribute decimal => hour > > If I do > > hours.each do |h| > h.my_hour > end > I get => 20.0 0.0 0.0 10.0 > > And this.. > myhour = [] > hours.each do |h| > myhour << hour That should be myhour << h.myhour though myhour is a very po

Re: [Rails] Creating array, decimal

2013-02-27 Thread Werner
After chaning the datatype to integer.. yes..works but as decimal (6,2) stays : ,#, Thanks so far Am Mittwoch, 27. Februar 2013 14:31:46 UTC+1 schrieb Dheeraj Kumar: > > or > > hours.map(&:my_hour) > > -- > Dheeraj Kumar > > On Wednesday 27 February 2013 at 6:57 PM, Carlos Mathiasen wrote: >

Re: [Rails] Creating array, decimal

2013-02-27 Thread Dheeraj Kumar
or hours.map(&:my_hour) -- Dheeraj Kumar On Wednesday 27 February 2013 at 6:57 PM, Carlos Mathiasen wrote: > this work for me: > > hours.collect{|h| h.my_hour} > > > Matt's > > On Wed, Feb 27, 2013 at 10:25 AM, Werner (mailto:webagentur.la...@googlemail.com)> wrote: > > Well my be I am

Re: [Rails] Creating array, decimal

2013-02-27 Thread Carlos Mathiasen
this work for me: hours.collect{|h| h.my_hour} Matt's On Wed, Feb 27, 2013 at 10:25 AM, Werner wrote: > Well my be I am a litte stubborn today.. > What I need is an array > > [20.0, 0.0, 0.0, 10.0] > > > > > Am Mittwoch, 27. Februar 2013 14:13:09 UTC+1 schrieb Carlos Mathiasen: >> >> >> >> Ma

Re: [Rails] Creating array, decimal

2013-02-27 Thread Werner
Well my be I am a litte stubborn today.. What I need is an array [20.0, 0.0, 0.0, 10.0] Am Mittwoch, 27. Februar 2013 14:13:09 UTC+1 schrieb Carlos Mathiasen: > > > > Matt's > > > On Wed, Feb 27, 2013 at 9:43 AM, Werner > > > wrote: > >> Thanks..but >> mhhh..it is not clear what you mean...

Re: [Rails] Creating array, decimal

2013-02-27 Thread Carlos Mathiasen
Matt's On Wed, Feb 27, 2013 at 9:43 AM, Werner wrote: > Thanks..but > mhhh..it is not clear what you mean... > > hour.join(",").to_s ? > no effect.. > > > Am Mittwoch, 27. Februar 2013 13:31:21 UTC+1 schrieb Dheeraj Kumar: >> >> override Hour's to_s method to return my_hour >> >> -- >> Dhee

[Rails] Strange behaviour of `has_many through` associations

2013-02-27 Thread Roman
class Member < ActiveRecord::Base has_many :contact_references has_many :contacts, through: :contact_references # contacts are of class Member end m1 = Member.new m2 = Member.new m1.contacts.include? m2 # => false m1.contacts << m2 m1.contacts.delete m2 m1.contacts # => [] m1.contacts.inclu

Re: [Rails] Creating array, decimal

2013-02-27 Thread Werner
Thanks..but mhhh..it is not clear what you mean... hour.join(",").to_s ? no effect.. Am Mittwoch, 27. Februar 2013 13:31:21 UTC+1 schrieb Dheeraj Kumar: > > override Hour's to_s method to return my_hour > > -- > Dheeraj Kumar > > On Wednesday 27 February 2013 at 5:53 PM, Werner wrote: > > H

[Rails] Exended modules and reject_if in nested_attributes

2013-02-27 Thread Hans
I have some common class methods in a module 'active_record_additions' that I load into a class by Activity by using extend ActiveRecordAdditions The Activity class uses nested_attributes_for with a reject_if method saved in the module 'active_record_additions' The problem is that the class met

Re: [Rails] Creating array, decimal

2013-02-27 Thread Dheeraj Kumar
override Hour's to_s method to return my_hour -- Dheeraj Kumar On Wednesday 27 February 2013 at 5:53 PM, Werner wrote: > Hi > I have an attribute decimal => hour > > If I do > > hours.each do |h| > h.my_hour > end > I get => 20.0 0.0 0.0 10.0 > > And this.. > myhour = [] > hours.each

[Rails] Creating array, decimal

2013-02-27 Thread Werner
Hi I have an attribute decimal => hour If I do hours.each do |h| h.my_hour end I get => 20.0 0.0 0.0 10.0 And this.. myhour = [] hours.each do |h| myhour << hour end myhour.join(",") I get => ,#, How do I get something like this ? 20.0, 0.0, 0.0, 10.0 Thanks for support -- You rece

Re: [Rails] Re: How to clear ActiveRecord query cache on associations with dynamic table

2013-02-27 Thread Jan Verhoek
Thanks! I might need that. There was another caveat I ran into: Active Record subclasses. They do not derive their table name dynamically from their parent class Op 27 feb 2013, om 00:56 heeft Justin S. het volgende geschreven: > We are doing something similarly crazy as well, you might try: >