Re: [Rails] Carrierwave metadata for original creation date?

2019-09-25 Thread Rob Biedenharn
> On 2019-Sep-25, at 14:45 , fugee ohu wrote: > > > > On Friday, September 20, 2019 at 5:13:44 PM UTC-4, Colin Law wrote: > On Fri, 20 Sep 2019 at 18:10, fugee ohu > wrote: > > > > How do I keep a record of the original creation date? What if I wanna > > preserve the original creation

Re: [Rails] How do I group and order by a model without loosing includes() method benefits

2019-06-06 Thread Rob Biedenharn
This probably works: relation = Project.joins(:bids).group(Arel.sql('projects.id')).order(Arel.sql('count(bids.id) DESC')) However, you might have to play around with it a bit if you need to put the `.includes(:bids, :user)` back in (or take the 1+N hit) -Rob > > On 2019-Jun-6, at 07:06 ,

Re: [Rails] Is there an administrator on this list?

2019-02-06 Thread Rob Biedenharn
Well, to be quite pedantic, fugee is more or a "help vampire" than a troll. [ https://www.urbandictionary.com/define.php?term=help%20vampire ]( https://www.urbandictionary.com/define.php?term=help%20vampire ) -Rob B. (different from Rob J.) -Original Message- From: "Rob Jonson"

Re: [Rails] lookups in array

2018-05-15 Thread Rob Biedenharn
> On 2018-May-15, at 14:39 , Walter Lee Davis wrote: > > If you can put those into a hash, then you can look up values by their keys, > or vice-versa. Just call STATE_TYPES.to_h and then you have a hash where the > names are the keys, and the abbreviations are the values.

Re: [Rails] Can you plz, explain to me part of this code ?

2018-04-26 Thread Rob Biedenharn
> On 2018-Apr-26, at 13:47 , Abdel Latif wrote: > > But [["AB_1020", "AB_950", "AB_50"], ["1000", "570"]] has non numerical > values too. > > On Thursday, April 26, 2018 at 1:05:53 PM UTC-4, Walter Lee Davis wrote: > > > On Apr 26, 2018, at 12:12 PM, Abdel Latif

Re: [Rails] help: ActionController::UnknownFormat in FooController#index

2018-03-05 Thread Rob Biedenharn
> On 2018-Mar-5, at 13:15 , Hassan Schroeder wrote: > > On Mon, Mar 5, 2018 at 9:59 AM, tom wrote: >> so how can i pass this along? why is it not assuming html? > > Because computers don't make assumptions?  > > Why are you telling it to

Re: [Rails] find_or_create_by rolls back

2018-02-01 Thread Rob Biedenharn
> On 2018-Feb-1, at 09:05 , fugee ohu wrote: > > > > On Thursday, February 1, 2018 at 8:54:56 AM UTC-5, Colin Law wrote: > On 1 February 2018 at 13:49, fugee ohu > wrote: > > > On Thursday, February 1, 2018 at 3:51:37 AM UTC-5, Colin Law wrote: > On

Re: [Rails] routes

2017-09-12 Thread Rob Biedenharn
I'm removing most of the "noise" from your output and focussing on the gallery-relevant bits: > On 2017-Sep-12, at 17:29 , Joe Guerra wrote: > > here's the output of my routes... (sorry about the formatting) > > Prefix Verb URI Pattern

Re: [Rails] confused

2017-07-11 Thread Rob Biedenharn
> On 2017-Jul-11, at 14:52 , 'Bigos' via Ruby on Rails: Talk > wrote: > > output.each{|o| o.map!{|i| {:space_nickname => i.space.nickname, > :nickname => i.nickname, :condition_number => i.condition, > :condition => >

Re: [Rails] acts_as_commentable_with_threading

2017-06-29 Thread Rob Biedenharn
> On 2017-Jun-29, at 10:59 , fugee ohu <fugee...@gmail.com> wrote: > On Wednesday, June 28, 2017 at 10:09:25 AM UTC-4, Rob Biedenharn wrote: >> On 2017-Jun-28, at 01:51 , fugee ohu <fuge...@gmail.com <>> wrote: >> >> On Monday, June 26, 2017

Re: [Rails] acts_as_commentable_with_threading

2017-06-28 Thread Rob Biedenharn
> On 2017-Jun-28, at 01:51 , fugee ohu <fugee...@gmail.com> wrote: > > On Monday, June 26, 2017 at 9:43:19 AM UTC-4, Rob Biedenharn wrote: > At this point, you should be able to look around a small codebase like this > and figure it out, but here are the "hints

Re: [Rails] acts_as_commentable_with_threading

2017-06-28 Thread Rob Biedenharn
> On 2017-Jun-28, at 01:49 , fugee ohu <fugee...@gmail.com> wrote: > > > > On Monday, June 26, 2017 at 9:43:19 AM UTC-4, Rob Biedenharn wrote: > At this point, you should be able to look around a small codebase like this > and figure it out, but here are the "

Re: [Rails] acts_as_commentable_with_threading

2017-06-26 Thread Rob Biedenharn
At this point, you should be able to look around a small codebase like this and figure it out, but here are the "hints": https://github.com/DustinFisher/acts-as-commentable-with-threading-example/blob/master/app/controllers/beers_controller.rb#L6

Re: [Rails] changing mysql engine and options in schema.rb

2017-04-10 Thread Rob Biedenharn
> On 2017-Apr-8, at 13:45 , Walter Lee Davis wrote: > > >> On Apr 7, 2017, at 11:03 PM, fugee ohu wrote: >> >> Also, of course I need the id's from the dumpfile to be inserted as the same >> values otherwise all relations would be borked fugee, This

Re: [Rails] changing mysql engine and options in schema.rb

2017-04-07 Thread Rob Biedenharn
> On 2017-Apr-7, at 15:26 , fugee ohu wrote: > > > > On Friday, April 7, 2017 at 3:02:50 PM UTC-4, Walter Lee Davis wrote: > Those options are all part of create database, which you would run once, not > on every migration. I have usually seen them set at the server

Re: [Rails] update query

2017-03-03 Thread Rob Biedenharn
> On 2017-Mar-3, at 09:46 , Joe Guerra wrote: > > > I'm not sure why I'm getting this... I'm trying to update a product in the > ruby console (and tried it within my app). > NoMethodError: undefined method `Startdate' for # > > > Did you mean? startdate > > >

Re: [Rails] vertical align a link_to(image_tag

2017-03-02 Thread Rob Biedenharn
> On 2017-Mar-2, at 19:00 , fugee ohu wrote: > > don't know why i can't get this image to vertical-align to the top of the > div, i'm not sure if i'm passing the class the right way > > here's my html > <%= link_to (image_tag("logo.png")), '/' , {:class => "logo"} %>

Re: [Rails] ruby embedded conditionals

2017-02-09 Thread Rob Biedenharn
> On 2017-Feb-9, at 12:10 , Joe Guerra wrote: > > I can't get my embedded if statement working in a html table. > > here's one row of my table from my cart index... > > <%= cart.created_at.strftime("%m/%d/%Y")%> | <%= cart.product_id > %> | <% if

Re: [Rails] local sqlite development vs Heroku PG deployment

2017-02-01 Thread Rob Biedenharn
> On 2017-Feb-1, at 18:24 , Walter Lee Davis wrote: > >> On Jan 31, 2017, at 10:55 PM, Joe Guerra wrote: >> >> ok, I solved of my problems. My git commit / push didn't work. Thats >> working now. >> >> >> the other thing is... >> >>

Re: [Rails] Calling 'sanitize' on collection_radio_buttons text_method

2016-10-27 Thread Rob Biedenharn
> On 2016-Oct-27, at 08:26 , Serguei Cambour wrote: > > I figured out how to achieve that: > > <%= f.collection_radio_buttons :name, [[true, 'H2O'] ,[false, > 'SO2']],:first, :last do |b| %> > <%= b.label {b.radio_button + sanitize(b.text, tags: %w(sub sup))}%> >

Re: [Rails] incorrect number of arguments

2016-06-29 Thread Rob Biedenharn
> About the end, its could be that a 'do' is missing a 'else' is incorrect, or > a missed an 'end' somewhere. > > On Wed, Jun 29, 2016 at 4:39 PM, Ruth Stephenson > wrote: > Than you so much for your reply and your help! I'm still a little >

Re: [Rails] Sending parameters to controller using link_to but getting the variable name itself.

2016-06-22 Thread Rob Biedenharn
> On 2016-Jun-22, at 04:20 , Padmahas Bn wrote: > > Hi, > > I'm not using any form in this web page. I only have labels, text boxes and > links with parameters. > The text_field code is > > <%= label_tag("Member code") %> > <%=

Re: [Rails] Site map url with protocol (https)

2016-05-23 Thread Rob Biedenharn
> On 2016-May-23, at 04:31 , Rajkumar Ulaganadhan wrote: > > Hi All, > > I have used dynamic_sitemaps for sitemap. > > > Command to generate xml file "rake sitemap:generate" > > After running this command it is generating this xml files > > > >

Re: [Rails] Moving a ruby/rails app from one server to another

2016-04-14 Thread Rob Biedenharn
> On 2016-Apr-14, at 14:51 , Vince Laurent wrote: > > "Have you checked the versions of all the gems (including rails) used > on the old server and installed those and only those on the new one?" > > using gem list --local > > the old system has 16, the new one 64 > Here

Re: [Rails] XML API as model in Rails application

2016-04-14 Thread Rob Biedenharn
> On 2016-Apr-14, at 10:56 , alan.kis...@gmail.com wrote: > > Hi all Rails developer, > > I am newcomer to Rails so I wonder what is best approach to rewrite my > current WHOIS search app (PHP) to Rails platform? Currently my idea is to put > all XML API cals and calculations in model, is

Re: [Rails] Inconsistent result of #sum

2016-02-24 Thread Rob Biedenharn
> On 2016-Feb-23, at 20:34 , Mengxi Liao wrote: > > For some reason the following two queries return different results > > Where there is only one activity record and price is 3.63 and quantity is > 16.19, the following codes return results of different rounding. > >

Re: [Rails] How can I set up a proper getter/setter?

2016-02-09 Thread Rob Biedenharn
> On 2016-Feb-8, at 19:19 , David McDonald wrote: > > I have a model named, Measurable, that stores many different types of of > measurements for different things. All the measurements can be represented > as a decimal, so my value column is of datatype decimal. My users

Re: [Rails] Hash table

2015-12-16 Thread Rob Biedenharn
> On 2015-Dec-16, at 17:24 , Scott Eisenberg wrote: > > Looks to me like you will have an Array of hashes. > > The ruby way something like a single line array select > > t.select{|tt| a.between?(tt[:min], tt[:max]) && b.between?(tt[:b_min], > tt[:b_max])} > > create

Re: [Rails] Why is admin_signed_in? false even after logging in as admin?

2015-12-11 Thread Rob Biedenharn
before_action :require_admin, except: [ :index, :show ] def require_admin unless admin_signed_in? redirect_to not_authorized_url end end > > On Friday, December 11, 2015 at 12:44:41 PM UTC-6, Rob Biedenharn wrote: > > > On 2015-Dec-11, at 13:12 , Jason Hsu, Ruby o

Re: [Rails] Re: Why is admin_signed_in? false even after logging in as admin?

2015-12-11 Thread Rob Biedenharn
> On 2015-Dec-11, at 13:12 , Jason Hsu, Ruby on High Speed Rails > wrote: > > The admin_signed_in? method comes from the Devise gem. Are you using the :admin scope to do the login? I.e., somewhere in your login_as helper there should be something like? sign_in

Re: [Rails] Rails-4.2.1 WebRick SSLEnable

2015-09-21 Thread Rob Biedenharn
> On 2015-Sep-21, at 15:59 , byrnejb wrote: > > in > /usr/lib64/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb > > at line 124 we see: > > url = "#{options[:SSLEnable] ? 'https' : > 'http'}://#{options[:Host]}:#{options[:Port]}" > > My question is:

Re: [Rails] Hi, I just started learning about an hour a go and already need help. :-)

2015-09-11 Thread Rob Biedenharn
> On 2015-Sep-11, at 11:00 , Nick Savage wrote: > > Okay I started with Learn the hard way with ruby. > My code is below and below each code is my question. > I guess I do not understand the identifiers because when I do them in my head > they dont add up. > > Any help

Re: [Rails] DB Code Optimization

2015-09-09 Thread Rob Biedenharn
> On 2015-Sep-9, at 11:19 , John Lahr wrote: > > I'm not sure I'm reading this right, but if you're looking for the answers to > the questions asked by a specific user wouldn't it be > > @user = User.find(params[:id] > @user.questions = the questions the user asked >

Re: [Rails] Method each strange behavior with AR association

2015-09-04 Thread Rob Biedenharn
> On 2015-Sep-4, at 15:56 , Николай Спелый wrote: > > Great ! > I already try write this logic but it not works. But when i copy-paste your > variant it's work. > So difference is in formating code, i write in one line, you write in three > lines. > That's nice for

Re: [Rails] Andriod tablets

2015-08-26 Thread Rob Biedenharn
On 2015-Aug-26, at 14:26 , Jason Weber unclejj4...@gmail.com wrote: hello, im new to learning ruby, does anyone know if you can use a tablet to run ruby or do you need a computer to run it? -- Check out http://ruboto.org/ http://ruboto.org/ if you want to run Ruby on Android. I don't

Re: [Rails] how to timeout a session in rails 2.3.9

2015-06-03 Thread Rob Biedenharn
At the VERY least, you should upgrade to Rails 2.3.18 as there were security fixes in every one of those 9 updates (some of them quite serious!). Speaking as someone who also has a client with many lines of code running in a Rails 2.3.18 framework-based application, you can really upgrade (a

Re: [Rails] Sort hash in model

2015-05-29 Thread Rob Biedenharn
On 2015-May-29, at 09:24 , Gm javapla...@gmail.com wrote: Hi, I have this hash: hash = { 4049=[4133, 100], 5814=[4075, 84], 382543=[4064, 74], 382544=[4065, 99], 382545=[4066, 75] } I need to sort (DESC) this hash by the second item of array. Example: 100, 84, 74, 99, 75 How can I

Re: [Rails] Generate image from base64

2015-05-13 Thread Rob Biedenharn
You might be able to look at https://github.com/madrobby/spark_pr which can be extended with: SparkCanvas.class_eval do def to_uri require 'base64' # doesn't attempt to respect some limits noted in RFC 2397 since the data: # url is supposed to be 'short' (1k), but the meaning of

Re: [Rails] Successfully installed rails-4.2.1 ERROR: Could not find a valid gem '4.2.1' (= 0) in any repo

2015-04-29 Thread Rob Biedenharn
On 2015-Apr-29, at 11:24 , Bailey J kidbay...@gmail.com wrote: Thanks that helps. So it was probably just the way I passed the command... This is what I typed sudo gem install rails 4.2.1 --no-ri --no-rdoc, does that look funny? You need to have -v in front of the version: sudo

Re: [Rails] Re: Successfully installed rails-4.2.1 ERROR: Could not find a valid gem '4.2.1' (= 0) in any repo

2015-04-29 Thread Rob Biedenharn
On 2015-Apr-29, at 13:30 , Bailey J kidbay...@gmail.com wrote: Thanks Rob, At this point I got the version I wanted even with the incorrect syntax, I can just leave it as it is? -Bailey Yes, of course, the response was basically to point out where your command had done something that

Re: [Rails] Replace find_by_sql with find (Rails 2.3)

2015-04-27 Thread Rob Biedenharn
On 2015-Apr-27, at 13:40 , Norm Scherer normsche...@earthlink.net wrote: It does have named scopes but I am not sure what that would bring to the table. How would one do it using named scopes? Norm On 04/25/2015 01:52 PM, Walter Lee Davis wrote: I can't recall, does Rails 2.3 have

Re: [Rails] Rails guides - No route matches [POST] /articles/new

2015-02-05 Thread Rob Biedenharn
On 2015-Feb-5, at 13:49 , Greg Bressler li...@ruby-forum.com wrote: I was working my way through Rails Guides getting started tutorial (http://guides.rubyonrails.org/getting_started.html). Everything was going well until the end of 5.2 when I was set to make a blog post. Any help that

Re: [Rails] Splitting documents in heroku

2015-02-04 Thread Rob Biedenharn
On 2015-Feb-4, at 11:40 , Chirag Aggarwal chi6...@gmail.com wrote: Hello, I am working on a slide sharing application which lets people upload presentations and pdfs and shows them in the browser. The website is hosted on heroku and slides are being uploaded to AWS S3 using CarrierWave

Re: [Rails] Intermittent NoMethodError: undefined method `url_for' for nil:NilClass

2015-01-23 Thread Rob Biedenharn
On 2015-Jan-23, at 12:08 , mikej mikejerem...@gmail.com wrote: I am receiving the error above intermittently, rarely on the same url twice. Backtrace below. Any ideas how to debug this gratefully received. Many thanks, Mike

Re: [Rails] `rails s -e production` loads development database not production

2015-01-21 Thread Rob Biedenharn
On 2015-Jan-21, at 16:13 , Mads Ohm Larsen li...@ruby-forum.com wrote: Jiajia Wang wrote in post #1166961: I'm running into a very weird rails server problem. I started a rails application in production mode with `rails s -e produciton` and got some db errors when visiting the site. Did

Re: [Rails] Mail notifications to self Net::SMTPAuthenticationError

2014-11-18 Thread Rob Biedenharn
Take a look at: https://support.google.com/accounts/answer/185833?hl=en -Rob On 2014-Nov-18, at 15:22 , bradford li bradfor...@gmail.com wrote: I am trying to set up a mailer to send myself notification methods. I am currently trying to get the mailer to send myself a simple message when I

Re: [Rails] undefined method `symbolize_keys' for

2014-11-10 Thread Rob Biedenharn
On 2014-Nov-10, at 16:17 , Dave Castellano li...@ruby-forum.com wrote: Dave Aronson wrote in post #1162130: Try fixing the src= bit. That's HTML, not Ruby. %= link_to(image_tag asset_path(#{subject.icon} + '.png'), index_books_path(:subject_id = subject.id)) % still throws same

Re: [Rails] Help with small rails app

2014-10-21 Thread Rob Biedenharn
On 2014-Oct-21, at 16:54 , Dominic Monaco jarvis...@gmail.com wrote: Hey guys I'm completely lost at this point I'm trying to make a simple app that takes an input in the form of a string (City, State) and sends that string to the google_places gem to do spot_by_query(gas station near

Re: [Rails] Help with small rails app

2014-10-21 Thread Rob Biedenharn
of the template. -Rob On 2014-Oct-21, at 17:16 , Rob Biedenharn r...@agileconsultingllc.com wrote: On 2014-Oct-21, at 16:54 , Dominic Monaco jarvis...@gmail.com wrote: Hey guys I'm completely lost at this point I'm trying to make a simple app that takes an input in the form of a string (City, State

Re: [Rails] Get the class name of the class who called the parent instance method.

2014-10-13 Thread Rob Biedenharn
On 2014-Oct-10, at 12:31 , Mike local@gmail.com wrote: You might want something like this. class Foo end Foo.instance_eval do def class_name self.name end end class Bar Foo end class Tar Foo end puts Foo.class_name #= Foo puts Bar.class_name #= Bar

Re: [Rails] Variable + string to specify variable

2014-07-31 Thread Rob Biedenharn
On 2014-Jul-30, at 10:59 , Eric Saupe ericsa...@gmail.com wrote: To expand on what Scott is saying here is some code that gives an example of what he is referring to. id = 100 x = rand(1..3) arrays = [Array.new, Array.new, Array.new] selected_array = arrays[x] selected_array.push(id)

Re: [Rails] Variable + string to specify variable

2014-07-31 Thread Rob Biedenharn
there would be a nice simpler Ruby way. I love the second solution, Rob. Below is the updated example. id = 100 arrays = [Array.new, Array.new, Array.new] arrays.sample.push(id) On Thursday, July 31, 2014 8:45:33 AM UTC-6, Rob Biedenharn wrote: On 2014-Jul-30, at 10:59 , Eric Saupe eric

Re: [Rails] Updating Rails 2 to Rails 3 or 4

2014-07-03 Thread Rob Biedenharn
On 2014-Jul-3, at 11:25 , Jason Fleetwood-Boldt t...@datatravels.com wrote: As was suggested to you by other posters, please read the upgrade guide carefully (here is the official one http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html) it is recommended that you have very

Re: [Rails] Updating Rails 2 to Rails 3 or 4

2014-07-03 Thread Rob Biedenharn
On 2014-Jul-3, at 15:49 , Rob Biedenharn r...@agileconsultingllc.com wrote: On 2014-Jul-3, at 11:25 , Jason Fleetwood-Boldt t...@datatravels.com wrote: As was suggested to you by other posters, please read the upgrade guide carefully (here is the official one http

Re: [Rails] rake aborated

2014-06-02 Thread Rob Biedenharn
On 2014-Jun-2, at 09:30 , Walter Lee Davis wa...@wdstudio.com wrote: This is normal. You need to run Rake from within the same folder as a Rakefile, as the error indicates. Make sure that your PATH is set to include the folder where rake lives, so that you can type the command from

Re: [Rails] Use table elements

2014-05-22 Thread Rob Biedenharn
On 2014-May-22, at 15:39 , Colin Law clan...@gmail.com wrote: On 22 May 2014 18:17, Fab Forestier li...@ruby-forum.com wrote: Colin Law wrote in post #1146811: On 22 May 2014 16:00, Fab Forestier li...@ruby-forum.com wrote: You said that, for example, the link should take you to the edit

Re: [Rails] Activity streams/News feeds with Aggregation, MySQL and Redis support

2014-03-21 Thread Rob Biedenharn
http://www.ruby-doc.org/stdlib-2.1.1/libdoc/rss/rdoc/RSS.html Rob Biedenharn rob.biedenh...@gmail.com On 2014-Mar-21, at 13:39 , Kenny Meyer knny.m...@gmail.com wrote: Can anyone recommend a gem/library? On Friday, March 21, 2014 2:38:45 PM UTC-3, Kenny Meyer wrote: I need to implement

Re: [Rails] How to start new pages automatically whenever the text string cannot fit on the current page in praw

2014-01-16 Thread Rob Biedenharn
page body, it should automatically place the remaining content in body portion of the new page. Please help me with the coding. This is the default behavior of Prawn. You should find an example of exactly this in the manual. http://prawn.majesticseacreature.com/manual.pdf -Rob Rob Biedenharn

Re: [Rails] Rails Engines problem: routing_error.erb within rescues/layout

2013-12-26 Thread Rob Biedenharn
On 2013-Dec-26, at 15:41 , jsnark s...@monmouth.com wrote: I'm working through the Rails Engines tutorial at http://edgeguides.rubyonrails.org/engines.html. I'm using ruby 1.9.3 and rails 3.1.12 on Linux. I'm stuck on section 4.1. When I try to access localhost:3000/blog I get:

Re: [Rails] Search

2013-12-23 Thread Rob Biedenharn
On 2013-Dec-24, at 01:45 , Daynthan Kabilan dayantha...@gmail.com wrote: Hi all, how to avoid single quote in our rails search Example in my users table user_name=ram'kumar my search query params[:name]=ramkumar @ans=Users.where(user_name=?,params[:name]) @ans =

Re: [Rails] Rails 4, subdomain routing

2013-11-21 Thread Rob Biedenharn
On 2013-Nov-21, at 04:12 , Tamara Temple tamouse.li...@gmail.com wrote: On Nov 20, 2013, at 4:04 AM, Srdjan Cengic cengas...@gmail.com wrote: Far as i know, link to http://api.localhost:3000/posts should work but i get routing error: No route matches [GET] /posts (Same with /posts.json)

Re: [Rails] :layout = question

2013-09-11 Thread Rob Biedenharn
processed first. The result and any 'content_for' sections have been saved before the layout is processed. The main result of the view is inserted where the `yield` is processed and the result of a `content_for :foo` will be inserted if there is a `yield :foo`. -Rob Rob Biedenharn rob.biedenh

Re: [Rails] fetch the Hash from a string

2013-08-26 Thread Rob Biedenharn
On 2013-Aug-26, at 17:10 , Love U Ruby wrote: tamouse m. wrote in post #1119628: On Aug 26, 2013, at 2:42 PM, Love U Ruby li...@ruby-forum.com wrote: You have a string which represents a what a Hash looks like. Why not run it through eval and see what you get? my_hash = eval(new_str)

Re: [Rails] Re: Re: Validations not working on complex DB transaction

2013-08-06 Thread Rob Biedenharn
On 2013-Aug-6, at 10:13 , masta Blasta wrote: selva4...@gmail.com wrote in post #1117870: Hi, The @user object is getting saved first. That time, there is no instuition membership attached to it. So one is getting created. Then when you save the instuition membership again inside the

Re: Re: Re: [Rails] Validations not working on complex DB transaction

2013-08-06 Thread Rob Biedenharn
On 2013-Aug-6, at 10:13 , masta Blasta wrote: selva4...@gmail.com wrote in post #1117870: Hi, The @user object is getting saved first. That time, there is no instuition membership attached to it. So one is getting created. Then when you save the instuition membership again inside the

Re: [Rails] help regarding internationalization for bootstrap button.

2013-07-18 Thread Rob Biedenharn
On 2013-Jul-18, at 04:51 , Tushar Patil wrote: Hi, Here i mention my hi.bootstrap.yml file, and i use create company = key use in form.html %= f.submit t('.create company', :default = t(helpers.links.Create Company)), :class = 'btn btn-primary' % It works fine for Hindi, but it

Re: [Rails] Delayed job in Rails 4

2013-07-08 Thread Rob Biedenharn
On 2013-Jul-8, at 12:15 , Karthikeyan A K wrote: I gem file I added this: gem 'delayed_job_active_record' Then when I bundled, this happened: $ bundle Fetching gem metadata from https://rubygems.org/.. Fetching gem metadata from https://rubygems.org/.. Resolving

Re: [Rails] Skip index in array.each_with_index loop

2013-05-23 Thread Rob Biedenharn
On 2013-May-23, at 05:24 , Ajit Teli wrote: Can anyone help me on how to skip index in ARRAY.each_with_index loop? Please look at below case: In a ARRAY.each_with_index loop, I would like increase the index by 10 whenever a condition is met. arr is array of numbers from 0 to 50

Re: [Rails] ERROR: Could not find a valid gem 'rails' (= 0), here is why: Unable to download data from

2013-04-12 Thread Rob Biedenharn
On 2013-Apr-12, at 14:02 , Phawin Khongkhasawan wrote: I want to install Rails on my Raspberry Pi but i got message ERROR: Could not find a valid gem 'rails' (= 0), here is why: Unable to download data fromhttp://rubygems.org/ - no such name (http://rubygems.org/latest_specs.4.8.gz)

Re: [Rails] using multiple joins in queries

2013-03-21 Thread Rob Biedenharn
On Mar 20, 2013, at 6:04 PM, John Merlino wrote: I have this query: Report. joins(:alerts). joins(:alert_code). I think that you're looking for 'includes' rather than 'joins' for these associations. Report.includes({:alerts = :alert_code}). To use

Re: [Rails] Disabling ActiveRecord type column subclassing

2013-02-19 Thread Rob Biedenharn
On Feb 18, 2013, at 7:01 PM, Jaime B. wrote: MichaelLatta wrote in post #227241: The 'type' method is a Ruby method for the class of an object. This is not a Ruby method. This is part of ActiveRecord, and is used by Rails to manage single-table inheritance. While it is true that 'type' is

Re: [Rails] Select and inner join

2013-02-15 Thread Rob Biedenharn
On Feb 15, 2013, at 10:12 AM, Colin Law wrote: On 15 February 2013 10:05, Lorenz Blackbird li...@ruby-forum.com wrote: I have a many-to-many relationship in my course model in this way: has_many :course_paragraphs has_many :paragraphs, :through = :course_paragraphs I use an inner join

Re: [Rails] can't create record with id

2013-01-31 Thread Rob Biedenharn
tl;dr Yes, you /can/ even if Colin's advice is good (AND I agree with him!) customer = Customer.new(other_attributes_here) {|c| c.id = user.id } customer.save On Jan 31, 2013, at 11:01 AM, Nishan T. wrote: I'm migrating the tables with existing data I've users table and all other tables

Re: [Rails] Help displaying text

2013-01-28 Thread Rob Biedenharn
On Jan 27, 2013, at 3:04 PM, Hassan Schroeder wrote: On Sun, Jan 27, 2013 at 11:31 AM, Dave Castellano li...@ruby-forum.com wrote: @formatted_question[:a] contains text with HTML markup. I want to display it in a field so I can control its vertical and horizontal size on the page. When

Re: [Rails] Cucumber issues when generating a new rails app.

2013-01-22 Thread Rob Biedenharn
On Jan 22, 2013, at 4:12 PM, Craig White wrote: On Jan 21, 2013, at 1:15 PM, Osifo Anosike wrote: Андрей Большов asnow@gmail.com wrote in post #1093053: What about: rake -T rake --version in common rake always print out some results, try run your command with `--trace`. If you have

Re: [Rails] Collect value

2013-01-21 Thread Rob Biedenharn
I tend to use a method like: module Enumerable # Returns a Hash keyed by the value of the block to the number times that # value was returned. If you have experience with the #group_by from # ActiveSupport, this would be like .group_by(block).map{|k,a|[k,a.size]} # (except it is a Hash

Re: [Rails] copy common attributes

2012-12-07 Thread Rob Biedenharn
On Dec 7, 2012, at 4:11 AM, Colin Law wrote: On 7 December 2012 01:30, renu mehta li...@ruby-forum.com wrote: Hello, If I have a model A as : name address phone and model B as: name address email My first suggestion would be that maybe the database design could be improved.

Re: [Rails] Error when updating with an image file

2012-12-06 Thread Rob Biedenharn
On Dec 6, 2012, at 9:11 AM, Colin Law wrote: On 6 December 2012 13:43, Jean-David jeandavid.co...@gmail.com wrote: Le jeudi 6 décembre 2012 13:23:58 UTC+1, Colin Law a écrit : On 6 December 2012 12:11, Jean-David jeandav...@gmail.com wrote: ... Thanks for the advise. Logging led me to a

Re: [Rails] Ajax test not working

2012-10-26 Thread Rob Biedenharn
On Oct 25, 2012, at 4:32 PM, Jason Walsh wrote: webber han wrote in post #1081214: Jason Walsh wrote in post #1080993: Am having real probs trying to use Ajax with my Rails app. I have set up a test as follows: in javascript file: window.onload = function() {

Re: [Rails] sum decimals

2012-10-26 Thread Rob Biedenharn
On Oct 26, 2012, at 8:18 AM, Werner wrote: I have a column hours which I want to sum up the decimals Week.sum('hour')= 22.5 But I want to select by project_id not the hole table. Week.find_all_by_project_id(@project.id, :select = workhour).sum #undefined method `+' for #Week hour:

Re: [Rails] How to configure PostgreSQL's test database before testing?

2012-10-24 Thread Rob Biedenharn
RAILS_ENV=test rake db:migrate Or you might have to specify: RAILS_ENV=test rake db:migrate:up VERSION={put your migration number here} It's likely that the normal db:test:prepare task doesn't support these extensions. -Rob On Oct 24, 2012, at 6:08 AM, David M wrote: My website uses

Re: [Rails] Why Heroku so slow?

2012-10-15 Thread Rob Biedenharn
On Oct 15, 2012, at 8:10 PM, Martin G. wrote: Dries Steenhouwer wrote in post #1054162: Adrian Caceres wrote in post #1044103: While on the subject does anyone know what heroku's timeout is before it brings down an app? It will bring your app down after 1 hour of inactivity. Our problem

Re: [Rails] dup/clone and taintedness

2012-10-08 Thread Rob Biedenharn
Taintedness refers to a default lack of trust in a value that was obtained from an unknown source. (Typically user input of some kind.) http://www.ruby-doc.org/docs/ProgrammingRuby/html/taint.html http://en.wikipedia.org/wiki/Taint_checking -Rob On Oct 7, 2012, at 9:54 PM, John Merlino wrote:

Re: [Rails] Array value to get except first two values

2012-09-15 Thread Rob Biedenharn
And, of course, you can just you plain 'ol Ruby for this too: a = [1,2,3,4,5] a[2..-1] # = [3,4,5] %w[ a b c d e ][3..-1] #= ['d', 'e'] -Rob On Sep 15, 2012, at 6:25 AM, Yong Gu wrote: If you are using Rails, %w( a b c d ).from(0) # = %w( a b c d ) %w( a b c d ).from(2) # = %w( c d )

Re: [Rails] embedded font

2012-08-14 Thread Rob Biedenharn
On Aug 14, 2012, at 5:32 AM, phoe san wrote: I want to add custom fonts in my rails project. fonts is in assets/stylesheets folder. In my Css . I declare font-face : @font-face { font-family: Zawgyi-One; src: url(/assets/stylesheets/Zawgyi-One.ttf); }. src: url('Zawgyi-one.ttf');

Re: [Rails] I18n.t('countries.NO') broken?

2012-04-02 Thread Rob Biedenharn
There are optimizations in YAML for YES and NO. Define it this way: en: countries: DE: Germany NO: Norway US: USA and it should work for you. -Rob On Mar 31, 2012, at 7:19 AM, Sven Schwyn wrote: Hi I've tried this on a virgin Rails 3.2.2 app. If you put the translations

Re: [Rails] How to encode (.) Dot in url Rails

2012-01-20 Thread Rob Biedenharn
On Jan 20, 2012, at 7:38 AM, Loganathan Sellapa wrote: Hi All, I am having routes like below to delete/list an user. map.connect 'developer/:user_name/delete',:controller=developers,:action=delete,:method=:delete You probably need to keep the '.' from being treated as a separator (like

Re: [Rails] formatting a date string

2012-01-18 Thread Rob Biedenharn
On Jan 17, 2012, at 8:26 PM, John Merlino wrote: Hey all, I have 90 records in database with this kind of format: 2011-05-10 11:23:15 So they are all 2011-05-10 but have different times. User enters two dates, and just in case the two dates are the same, I want to ensure I grab all

Re: [Rails] belongs_to and order

2011-12-09 Thread Rob Biedenharn
On Dec 9, 2011, at 2:28 PM, Fresh Mix wrote: Two tables: Users (id, username) Books (id, name, user_id) User has_many :books and Book belongs_to :user How can I order Books by username? @books = Book.all.order(user.username) @books =

Re: [Rails] one-to-one relationship

2011-12-01 Thread Rob Biedenharn
have the right default for the foreign key (which is the _id after the class name rather than the association name), but specifying it works just fine, of course. -Rob Rob Biedenharn r...@agileconsultingllc.com http://AgileConsultingLLC.com/ r...@gaslightsoftware.com

Re: [Rails] Re: Ruby on Windows -- *AVOID* running RoRails on Windows!

2011-11-16 Thread Rob Biedenharn
chopping and changing between versions of Ruby, you'll want to look at that Ubuntu virtual machine. You've missed pik https://github.com/vertiginous/pik (but I develop on Mac OSX so I've never used it) -Rob Rob Biedenharn r...@agileconsultingllc.com http://AgileConsultingLLC.com/ r

Re: [Rails] what a disappointing evening!

2011-11-13 Thread Rob Biedenharn
', ' 1.1' When you add that to '~ 1.0.17', you end up with: '= 1.0.17', ' 1.1' So jquery-rails 1.0.17 should be OK. Perhaps you need to do: bundle update jquery-rails To allow a version different than 1.0.16 to be installed which is consistent with all the constraints. -Rob Rob

Re: [Rails] how to use mutiple yields

2011-11-12 Thread Rob Biedenharn
the associated content_for blocks are not together already making this a bit moot. -Rob How to call this in a single method You could also move those three lines into a partial, and render that with a single line in your layout. Rob Biedenharn r...@agileconsultingllc.com http

Re: [Rails] Re: functional testing API: GET versus POST?

2011-11-07 Thread Rob Biedenharn
action look like? -Rob Rob Biedenharn r...@agileconsultingllc.com http://AgileConsultingLLC.com/ r...@gaslightsoftware.com http://GaslightSoftware.com/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

Re: [Rails] Add an index to a form

2011-10-26 Thread Rob Biedenharn
[children_attributes][], user do | fes| % %= f.semantic_fields_for(user[children_attributes][], user) do |fes| % -Rob Rob Biedenharn r...@agileconsultingllc.com http://AgileConsultingLLC.com/ r...@gaslightsoftware.com http://GaslightSoftware.com/ -- You received

Re: [Rails] Re: Postgresql adapter not working

2011-10-06 Thread Rob Biedenharn
six ubuntu workstations configured and next week should actually spin up a demo rails app. -Rob Rob Biedenharn r...@agileconsultingllc.com http://AgileConsultingLLC.com/ r...@gaslightsoftware.com http://GaslightSoftware.com/ -- You received this message because you

Re: [Rails] fubar and Gemfile.lock

2011-09-29 Thread Rob Biedenharn
just solve your problem. -Rob Rob Biedenharn r...@agileconsultingllc.com http://AgileConsultingLLC.com/ r...@gaslightsoftware.com http://GaslightSoftware.com/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group

Re: [Rails] Re: fubar and Gemfile.lock

2011-09-29 Thread Rob Biedenharn
On Sep 29, 2011, at 5:00 PM, Barney wrote: On Sep 29, 2:30 pm, Rob Biedenharn r...@agileconsultingllc.com wrote: On Sep 29, 2011, at 1:16 PM, Barney wrote: Hi All, In trying to port a working version from one computer to another I had installed the requisites and copied over the files

Re: [Rails] Re: fubar and Gemfile.lock

2011-09-29 Thread Rob Biedenharn
On Sep 29, 2011, at 6:43 PM, Peter Vandenabeele wrote: On Thu, Sep 29, 2011 at 11:09 PM, Rob Biedenharn r...@agileconsultingllc.com wrote: On Sep 29, 2011, at 5:00 PM, Barney wrote: On Sep 29, 2:30 pm, Rob Biedenharn r...@agileconsultingllc.com wrote: On Sep 29, 2011, at 1:16 PM, Barney

Re: [Rails] includes from a table that does not have an id field

2011-09-29 Thread Rob Biedenharn
out this issue thanks Kiran You should not need an `id` on the admins table, but you almost certainly want to have an index on each of the `file_id` and `user_id` columns. -Rob Rob Biedenharn r...@agileconsultingllc.com http://AgileConsultingLLC.com/ r

  1   2   3   4   5   >