Re: [Rails] Thin Controllers, Thin AR Models too!

2012-05-10 Thread Sebastião G . Ferreira Júnior
A guy named "M Daubs" sent an e-mail directly to me recommending me to read the book "Objects on Rails". So I think I should share here: http://objectsonrails.com/ (free html version, USD5 for kindle/pdf drm free..). In answer to Colin Law, Thanks for your reply. But this is not really a technical

[Rails] Re: how to prevent the user from accessing the app.after logout with back button(rails only)

2012-05-10 Thread javinto
Several solutions in the before mentioned post were suggested. I used: before_filter :set_cache_buster def set_cache_buster response.headers["Cache-Control"] = "no-cache, no-store, max- age=0, must-revalidate" response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "

Re: [Rails] Is it suitable using STI?

2012-05-10 Thread Jeremy Walker
On 10 May 2012 16:26, Mauro wrote: > On 10 May 2012 17:05, Greg Akins wrote: > > > > > > On Thu, May 10, 2012 at 10:57 AM, Mauro wrote: > >> > >> I have problems on a simple design problem. > >> I have many companies. Each company have one or more commercial > activity. > >> Activities types ar

Re: [Rails] Is it suitable using STI?

2012-05-10 Thread Mauro
On 10 May 2012 17:05, Greg Akins wrote: > > > On Thu, May 10, 2012 at 10:57 AM, Mauro wrote: >> >> I have problems on a simple design problem. >> I have many companies. Each company have one or more commercial activity. >> Activities types are: ecommerce, local unit, television, automatic >> vend

Re: [Rails] Is it suitable using STI?

2012-05-10 Thread Jeremy Walker
On 10 May 2012 16:05, Greg Akins wrote: > > > On Thu, May 10, 2012 at 10:57 AM, Mauro wrote: > >> I have problems on a simple design problem. >> I have many companies. Each company have one or more commercial activity. >> Activities types are: ecommerce, local unit, television, automatic >> vend

Re: [Rails] Is it suitable using STI?

2012-05-10 Thread Greg Akins
On Thu, May 10, 2012 at 10:57 AM, Mauro wrote: > I have problems on a simple design problem. > I have many companies. Each company have one or more commercial activity. > Activities types are: ecommerce, local unit, television, automatic > vending machines, and so on. > So can each Company have

Re: [Rails] Re: Rails 3.2.3 not including javascript

2012-05-10 Thread Mauro
On 10 May 2012 16:20, Colin Law wrote: > On 10 May 2012 15:11, beau trepp wrote: >> I'll try installing an older version of ruby then. Seems odd, I use RVM, and >> I generally aim for stable so wasn't expecting that to happen. > > I don't quite understand what you are saying here.  Do you mean th

[Rails] Is it suitable using STI?

2012-05-10 Thread Mauro
I have problems on a simple design problem. I have many companies. Each company have one or more commercial activity. Activities types are: ecommerce, local unit, television, automatic vending machines, and so on. Company may have one or more ecommerce activity or one or more local unit activity, o

[Rails] Marginalia's :line option

2012-05-10 Thread Martin Streicher
I am trying to use the Marginalia gem's :line parameter. It emits something, but it seems to always say 'script/rails:6', as in... /*application:Realvolve,controller:contacts,action:index,line:script/rails:6:in `require'*/ This is at the top of application.rb: require File.expand_path('../bo

Re: [Rails] Re: Rails 3.2.3 not including javascript

2012-05-10 Thread Colin Law
On 10 May 2012 15:11, beau trepp wrote: > I'll try installing an older version of ruby then. Seems odd, I use RVM, and > I generally aim for stable so wasn't expecting that to happen. I don't quite understand what you are saying here. Do you mean that you believe Ruby 2 is current stable release

Re: [Rails] Rails 3.2.3 not including javascript

2012-05-10 Thread radhames brito
Watch this railscast: http://railscasts.com/episodes/279-understanding-the-asset-pipeline -- 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 gr

Re: [Rails] Re: Rails 3.2.3 not including javascript

2012-05-10 Thread beau trepp
I'll try installing an older version of ruby then. Seems odd, I use RVM, and I generally aim for stable so wasn't expecting that to happen. I admitted I don't know the intricacies of Rails asset pipeling. Still I know enough about javascript to identify that being the only JS file included (or scr

[Rails] Re: Rails 3.2.3 not including javascript

2012-05-10 Thread Robert Walker
Beau wrote in post #1060314: > Howdy, > > Using rails 3.2.3 and ruby 2.0.0dev. Running rails s, doesn't seem to > include the javascript. This causes Delete/destroy to never work. It > just > defaults to a GET and thus show. > > I tested this in a barebones project AFAIK Rails 3.2.3 is not support

Re: [Rails] Rails 3.2.3 not including javascript

2012-05-10 Thread Jeremy Walker
On 10 May 2012 14:26, Beau wrote: > Howdy, > > Using rails 3.2.3 and ruby 2.0.0dev. Running rails s, doesn't seem to > include the javascript. This causes Delete/destroy to never work. It just > defaults to a GET and thus show. > > I tested this in a barebones project > > rails new testingjs > --

[Rails] Rails 3.2.3 not including javascript

2012-05-10 Thread Beau
Howdy, Using rails 3.2.3 and ruby 2.0.0dev. Running rails s, doesn't seem to include the javascript. This causes Delete/destroy to never work. It just defaults to a GET and thus show. I tested this in a barebones project rails new testingjs --uncomment ruby race in gemfile bundle install rails

[Rails] Seeking for an Expert ROR

2012-05-10 Thread Zeev is looking for an Android Developer -7 month experience in Jerusalem .
Hi Friends I am looking for a Professional . a Senior Ruby on Rails developer with vast experience Its all about new generation distributed . web -based business system / very smart platform Big data. Analysis process .Front end web application and using code with ROR .. its a great challenge a

[Rails] Seeking for an Expert

2012-05-10 Thread Zeev is looking for an Android Developer -7 month experience in Jerusalem .
Hi Friends I am looking for a Professional . a Senior Ruby on Rails developer with vast experience Its all about new generation distributed . web -based business system / very smart platform Big data. Analysis process .Front end web application and using code with ROR .. its a great challenge a

[Rails] Re: JQuery + Coffeescript

2012-05-10 Thread Frederick Cheung
On May 10, 10:06 am, Werner Laude wrote: > Am 10.05.2012 um 09:30 schrieb Frederick Cheung: > > >> #coffee > >> jQuery ($) -> > >>   $("#query").change -> > >>     $.get "search", (data) -> > >>       $("#results").html data > > > Your javascript is not actually doing anything with the value of

[Rails] Re: Rspec for custom validations

2012-05-10 Thread Frederick Cheung
On May 10, 10:47 am, venkata reddy wrote: > Hi all, i am very new when it comes to writing tests, can anyone give > me an idea how to write RSpec test for the following custom > validation. > > def validate_campaign_and_ad >     unless self.ad.nil? || self.ad.campaign_id == self.campaign_id >  

Re: [Rails] Re: select box pre-selecting an option

2012-05-10 Thread Jeremy Walker
On 10 May 2012 12:13, Michael Baldock wrote: > Thanks for that, it works exactly as you said! cheers, now I have the > line > > <%= f.select(:formation_csv, @formations) %> > > and it magically knows which one to select. > > I'm still v curios as to why the "options_for_select(formations_array, >

[Rails] Re: select box pre-selecting an option

2012-05-10 Thread Michael Baldock
Thanks for that, it works exactly as you said! cheers, now I have the line <%= f.select(:formation_csv, @formations) %> and it magically knows which one to select. I'm still v curios as to why the "options_for_select(formations_array, 2)" didn't do anything, is it because when I'm using this i

Re: [Rails] select box pre-selecting an option

2012-05-10 Thread Jeremy Walker
On 10 May 2012 11:45, Michael Baldock wrote: > Can anyone please tell me what's going on here, I've copied something > pretty much directly from rails guides, but it's just not doing what > it's supposed to! > > (Or I'm doing something stupid!) > > rails - 3.2.2 > ruby 1.9.3 > > my view has the f

[Rails] select box pre-selecting an option

2012-05-10 Thread Michael Baldock
Can anyone please tell me what's going on here, I've copied something pretty much directly from rails guides, but it's just not doing what it's supposed to! (Or I'm doing something stupid!) rails - 3.2.2 ruby 1.9.3 my view has the following 1 - <% formations_array = @formations.map { |f| [f, f

Re: [Rails] how to encryption and decryption a string or integer in ruby

2012-05-10 Thread hanish jadala
thanks for your link On Thu, May 10, 2012 at 3:40 PM, Michael Pavling wrote: > On 10 May 2012 11:01, honey ruby wrote: > > i want to encrypt and decrypt a number or string in RoR. is there any > > gem or plug-in for that. > > http://lmgtfy.com/?q=ruby+encrypt+decrypt > > -- > You received this

Re: [Rails] how to encryption and decryption a string or integer in ruby

2012-05-10 Thread Michael Pavling
On 10 May 2012 11:01, honey ruby wrote: > i want to encrypt and decrypt a number or string in RoR. is there any > gem or plug-in for that. http://lmgtfy.com/?q=ruby+encrypt+decrypt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post

[Rails] how to encryption and decryption a string or integer in ruby

2012-05-10 Thread honey ruby
hi everyone i want to encrypt and decrypt a number or string in RoR. is there any gem or plug-in for that. thanks in advance -- 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@googlegr

[Rails] Rspec for custom validations

2012-05-10 Thread venkata reddy
Hi all, i am very new when it comes to writing tests, can anyone give me an idea how to write RSpec test for the following custom validation. def validate_campaign_and_ad unless self.ad.nil? || self.ad.campaign_id == self.campaign_id errors.add(:campaign_id, "ad.campaign (#{self.ad.camp

[Rails] Re: Freelance Ruby on Rails Developer needed for a project

2012-05-10 Thread DEVA R.
hi, I have 1 year experience in ruby on rails.I will work for you.let me know if you are interested vishal.singh...@gmail.com . Regards, Devarasu Ruby On Rails Developer -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups

[Rails] Re: Re: Re: Re: Has_Many, another mass assign headache

2012-05-10 Thread Miguel A.
> <%= f.fields_for :hphoto do |builder| %> > Since you have has_many hphotos you need fields_for :hphotos > > Colin Indeed Colin. Also, I missed an attr_accessible when I was testing/modifying code. The :hphoto in the Hphoto model. You've already answered 2 of my questions with positive results,

Re: [Rails] Re: JQuery + Coffeescript

2012-05-10 Thread Martin Wawrusch
Here is what you need to do (there are multiple ways of doing it, I am showing you an easy one, definitely not the best one). You actually have 2 different views, one that renders the search page and another one that renders only the list content, which is invoked through jquery. The behavior you

Re: [Rails] Re: JQuery + Coffeescript

2012-05-10 Thread Werner Laude
Am 10.05.2012 um 09:30 schrieb Frederick Cheung: Hi Fred thanks.. > > > On May 9, 12:58 pm, Werner wrote: > >> What I have: >> >> #view >> <%= text_field_tag :query%> >> >> >> <%...@clients.each do |client|%> >> <%= client.name%> >> <%end%> >> >> >> #controller >> def search

[Rails] Re: simple noob question about routes

2012-05-10 Thread Michael Baldock
Cheers for the help guys, the routes for members / the collection is interesting I'll need to read more about how these work, cheers -- 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 t

[Rails] Model definition using couchDB

2012-05-10 Thread Paulo Carvalho
Hello I am writing a RoR application which connects to a noSQL database (couchDB). In the database, I have an author document. The author has a first_name and a last_name. It also have inside another document: a book. The book has a title and a year of publication. Example: { author { "fi

[Rails] getting started with jQuery rails 3.2

2012-05-10 Thread Michael Baldock
Hi all, I'm trying to work out how to get started using some jQuery in my rails app. rails -v = 3.2.2 ruby -v = 1.9.3-p194 I'm only sporadically a web-developer, and still quite inexperienced with jQuery especially, so I may be making an obvious mistake. Essentially, I've done very little after

Re: [Rails] how to prevent the user from accessing the app.after logout with back button(rails only)

2012-05-10 Thread Michael Pavling
On 10 May 2012 08:46, hanish jadala wrote: > thanks for your reply i have added your code and i checked it. if i click > back button after logout it is still going back to app but it is give me the > error " > > undefined method `username' for nil:NilClass" it shows it going back to app. It's not

Re: [Rails] Thin Controllers, Thin AR Models too!

2012-05-10 Thread Colin Law
On 10 May 2012 04:14, Sebastião G. Ferreira Júnior wrote: > After seeing DestroyAllSoftware screencasts from Gary Bernhardt, > reading this post > http://solnic.eu/2011/08/01/making-activerecord-models-thin.html , > talking with some people about the issue and based on my personal > experience, I

Re: [Rails] how to prevent the user from accessing the app.after logout with back button(rails only)

2012-05-10 Thread hanish jadala
thanks for your reply i have added your code and i checked it. if i click back button after logout it is still going back to app but it is give me the error " undefined method `username' for nil:NilClass" it shows it going back to app. On Thu, May 10, 2012 at 12:53 PM, Michael Pavling wrote: >

[Rails] Re: One to many relationships

2012-05-10 Thread Frederick Cheung
On May 8, 8:21 pm, Padmoja Roy wrote: > I was trying to make one to many relationships  -  between professors > controller to rate_professors controller and used scaffold. it's > giving me this error- > > NoMethodError in RateProfessorsController#index > undefined method `rate_professors' for ni

Re: [Rails] Creating an API key (many to many mapping), how would I go about it

2012-05-10 Thread Colin Law
On 10 May 2012 01:03, beau trepp wrote: > Ideally I'm viewing this as a fairly simple feature to add. Also I'm hoping > this will help Mr solidify best practice for how to do things. > > Where I'm getting confused is what should be creating the user/key entries. > I could make this part of the opt

[Rails] Re: JQuery + Coffeescript

2012-05-10 Thread Frederick Cheung
On May 9, 12:58 pm, Werner wrote: > What I have: > > #view > <%= text_field_tag :query%> > > >   <%...@clients.each do |client|%> >       <%=  client.name%> >   <%end%> > > > #controller > def search >     @clients = Client.where("name like ?", "%#{params[:query]} > %").limit(5) > end > > #co

Re: [Rails] how to prevent the user from accessing the app.after logout with back button(rails only)

2012-05-10 Thread Michael Pavling
On 10 May 2012 07:54, honey ruby wrote: > after logging out of my site if i click back button it is going back > how can i restrict this problem It's a browser caching issue, so you need to tell the browser not to cache. http://stackoverflow.com/questions/711418/how-to-prevent-browser-page-cachi

[Rails] Thin Controllers, Thin AR Models too!

2012-05-10 Thread Sebastião G . Ferreira Júnior
After seeing DestroyAllSoftware screencasts from Gary Bernhardt, reading this post http://solnic.eu/2011/08/01/making-activerecord-models-thin.html , talking with some people about the issue and based on my personal experience, I found that they're all right. So I'm on a new project trying to follo

[Rails] rails3, kaminari and pg_search, Maintaining a search subset of data when sorting?

2012-05-10 Thread captdowner
I hope someone may have solved this issue before. It involves rails3, kaminari and pg_search. I've got pg_search working, but now the search is returned and the default order is not maintained. I don't mind having the subset returned in any order. But I want to maintain the subset of records retur

[Rails] JQuery + Coffeescript

2012-05-10 Thread Werner
Hi..I would be happy to get some support. What I want is: 1. a query field#type in some letters looking for a name 2. a dynamic updated list according to the typed-in letters What I have: #view <%= text_field_tag :query%> <%@clients.each do |client|%> <%= client.name%> <%end%>

[Rails] One to many relationships

2012-05-10 Thread Padmoja Roy
I was trying to make one to many relationships - between professors controller to rate_professors controller and used scaffold. it's giving me this error- NoMethodError in RateProfessorsController#index undefined method `rate_professors' for nil:NilClass app/controllers/rate_professors_controlle