[Rails] Re: Is it possible to serialize an ActiveRecord object?

2019-12-05 Thread Jim
On Tuesday, December 3, 2019 at 5:55:24 PM UTC-5, Daniel Baez wrote: > > >- What is going wrong with your DB that its built-in caching is >insufficient? > - Load, there are millions of queries running a sec now, and the > Active Model classes I want to update are read constant

Re: [Rails] How do I run an action on a dedicated thread?

2019-08-11 Thread Jim
arge, it seems like you might be over-thinking this. Jim Crate On Saturday, August 10, 2019 at 9:56:21 PM UTC-7, San Ji wrote: > > Thank you, Phil > The latter suggestion is actually what I planned to do, with nginx handle > the path routing instead of having separated endpoints.

[Rails] Vulnerabililty with bootstrap-sass 3.2.0.3

2019-04-03 Thread Jim Ruther Nill
As outlined in https://snyk.io/blog/malicious-remote-code-execution-backdoor-discovered-in-the-popular-bootstrap-sass-ruby-gem/ TLDR If you use bootstrap-sass version 3.2.0.3, just do bundle update bootstrap-sass and you're good to go -- -

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

2019-02-07 Thread Jim
On Wednesday, February 6, 2019 at 4:32:26 AM UTC-8, Rob Jonson wrote: > > > If there is an administrator, please consider removing the individual from > this list. > > If there is no administrator, then my request to everyone else is to treat > this like trolling, and just stop feeding the troll

Re: [Rails] Why is id off by one or defined different in edit vs in update?

2018-06-08 Thread Jim Ruther Nill
On Sat, Jun 9, 2018 at 5:54 AM, Robert Phillips wrote: > why is id off by one or defined different in edit vs in update? I will > explain what I mean > > I have a controller called Bottles and a model Bottle > > My config\routes.rb file has the line- resources :bottles > > I have this controller

Re: [Rails] override or add stylesheet to mounted engine pages

2018-02-26 Thread Jim Ruther Nill
On Tue, Feb 27, 2018 at 1:32 PM, fugee ohu wrote: > I mounted an engine and it has it's own assets pipeline How do I override > or add to it? It's in a subdirectory under the gem root path > /app/assets/stylesheets/blogit There's no application.css file in the > folder, only other css files I cre

[Rails] Re: how to find that array include only some multiple values ? ruby

2018-02-26 Thread jim
7;,'Hired','Provisionally Hired','Hired','Provisionally Hired','Hired'] if (employment_status - ['Hired', 'Provisionally Hired']).empty? # ... end That removes the values you are looking for from the original array, and if it's empty

[Rails] Re: How to trace a html button non-event? (Rails Authorization With Pundit)

2017-07-13 Thread jim
Hey Ralph, Happy to help! The readme is a great resource: https://github.com/turbolinks/turbolinks Jim On Friday, July 7, 2017 at 3:22:48 PM UTC-4, Ralph Shnelvar wrote: > > May all the gods of all the religions bless you, your house, your family, > your extended family, and you

Re: [Rails] Rspec =begin =end

2017-07-11 Thread Jim Ruther Nill
On Tue, Jul 11, 2017 at 9:27 PM, Ralph Shnelvar wrote: > In a file named spec/spec_helper.rb I see > # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration > RSpec.configure do |config| > # The settings below are suggested to provide a good initial experience > # with RSpec, but feel

[Rails] Re: devise: methods of current_user

2017-07-07 Thread jim
Why not try and see if it works? On Friday, July 7, 2017 at 11:52:39 AM UTC-4, fugee ohu wrote: > > Can I apply method calls to current_user directly like > current_user.pictures instead of @user=User.find(current_user.id); > @user.picures > -- You received this message because you are subscr

[Rails] Re: How to trace a html button non-event? (Rails Authorization With Pundit)

2017-07-07 Thread jim
like http://code.runnable.com Jim On Wednesday, July 5, 2017 at 1:51:46 AM UTC-4, Ralph Shnelvar wrote: > > This is my first post here. Comments on style, etc., are appreciated. > > An answer is even more appreciated. > > This is a continuation of my question at > https://stack

Re: [Rails] div_for

2017-06-28 Thread Jim Ruther Nill
On Wed, Jun 28, 2017 at 1:38 PM, fugee ohu wrote: > > > On Tuesday, June 27, 2017 at 8:01:40 PM UTC-4, Walter Lee Davis wrote: >> >> >> > On Jun 27, 2017, at 9:12 AM, fugee ohu wrote: >> > >> > >> > >> > On Tuesday, June 27, 2017 at 7:32:33 AM UTC-4, Walter Lee Davis wrote: >> > >> > > On Jun 27

Re: [Rails] passing parameters to delete link_to

2017-06-06 Thread Jim Ruther Nill
On Wed, Jun 7, 2017 at 11:24 AM, Jim Ruther Nill wrote: > > > On Wed, Jun 7, 2017 at 11:21 AM, fugee ohu wrote: > >> The rails scaffolding generator creates delete links as objects in index >> views so why when I google how to pass params to a delete link all the >>

Re: [Rails] passing parameters to delete link_to

2017-06-06 Thread Jim Ruther Nill
On Wed, Jun 7, 2017 at 11:21 AM, fugee ohu wrote: > The rails scaffolding generator creates delete links as objects in index > views so why when I google how to pass params to a delete link all the > answers are examples where a path is used My links don't have a path, they > have an object That'

[Rails] Part time remote work

2017-04-30 Thread Jim Ruther Nill
Hi guys, I'm posting another "looking for remote work" post as things have settled down with the last project. If anyone is looking for a Rails developer with solid experience, just hit me up and let's talk. I can commit around 4 hours a day as I have full time work. Thanks a lot and have a gre

Re: [Rails] migration problems

2017-04-27 Thread Jim Ruther Nill
eps you from using postgres for development? > > Thanks, > Joe > > On Thursday, April 27, 2017 at 7:02:48 PM UTC-4, jim wrote: >> >> >> >> On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra wrote: >> >>> Hi, I got stuck on a migration (basically to fix

Re: [Rails] migration problems

2017-04-27 Thread Jim Ruther Nill
On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra wrote: > Hi, I got stuck on a migration (basically to fix a column name). I > actually went into the table itself and corrected the problem. My herkou > migration gets stuck, and I've got other migrations behind it that aren't > running. > If you've

Re: [Rails] Re: Looking for a part time project

2017-03-31 Thread Jim Ruther Nill
Hi Tariq, I'm available! Just let me know what you need and see what we can set up. Cheers, Jim On Fri, Mar 31, 2017 at 10:33 PM, tariq khan wrote: > Hi Jim, >hope you will be fine, i read your post so i want to contact > you, i need a web developer who work

Re: [Rails] Re: Looking for a part time project

2017-03-16 Thread Jim Ruther Nill
Hi Falk, I'm definitely interested. My hourly rate is $50/hour. I usually do a trial period involving 1-2 simple tasks. If you're keen, let me know :) On Thu, Mar 16, 2017 at 5:04 PM, FALK LIEDER wrote: > Hi Jim, > > I just saw your post on the Ruby on Rails list, and I

[Rails] Looking for a part time project

2017-03-10 Thread Jim Ruther Nill
Hi, I am deeply sorry if this is an inappropriate post for this group. Please disregard if it is. I'm Jim, a Rails developer for about 8 years (turning 9 in May). I'm looking for a part time project that I could work on after office hours as I am away from my family and have an ample

[Rails] Re: filter dates from where clause

2017-01-29 Thread jim
ActiveRecord will handle converting a Time into something your database understands, so you don't need to worry about that. You can also write the where clause manually like you did, or you can use arel, which would be my preference. You can also chain .where()'s, since they just return Activ

[Rails] Re: logstash ruby filter ( a question from novice )

2017-01-17 Thread jim
ays back into a Hash. We do this with by calling #to_h <http://ruby-doc.org/core-2.4.0/Array.html#method-i-to_h> on the Array, which will interpret the Array as an Array containing other Arrays of key-value pairs and return a Hash. There's a lot going on in those

[Rails] Re: Flush rendering immediately?

2016-08-19 Thread Jim
to fork a new long-running process. It handles closing/re-opening database connections, etc. https://github.com/tra/spawnling Another alternative could be Server-Sent Events (SSE), which works with Passenger > 4.0.5. It will require changes in how you set up the front end as well, but is goo

[Rails] Re: Rspec passes test only for one time

2016-06-21 Thread jim
Your test database isn't being cleared after each test run. Normally this problem is solved by running each test in a transaction which is rolled back at the completion of each test. You can enable this in RSpec with the use_transactional_fixtures option. Alternatively, check out the database_

[Rails] Re: Passing data from model to views

2016-06-21 Thread jim
Personally, I would view the Receipt Summary as its own class, maybe ReceiptRpt::ReceiptSummary. I'd probably do the work currently in your receiptsummary method in the initialize method, then store the values that you need in your view in instance variables, and define attr_readers for them.

[Rails] Re: How do I setup this odd join?

2016-05-01 Thread Jim
students and districts (your reporting districts), correct? You could add a field in that table to indicate the primary district. If a student will only ever have one primary district, I would generally prefer the first way. Jim Crate -- You received this message because you are subs

[Rails] Re: can i use OR and also AND in the same where clause?

2016-04-12 Thread jim
ou could do this: current_user.profile.friendables.accepted.where(Friendable.arel_table[: from_id].eq(current_user.id).or(Friendable.arel_table[:to_id].eq( current_user.id))) Jim On Friday, April 8, 2016 at 4:45:42 AM UTC-4, Giedrius Rimkus wrote: > > You can achieve this with: >

[Rails] Re: remote:true with redirect. Does it make sence?

2016-03-20 Thread jim
You got it! Yup, it's on you, but it's surprisingly simple since you're only working on the response side. In just a few lines of code, I've done some cool stuff without a page refresh or client side framework. Jim On Tuesday, March 15, 2016 at 2:44:10 PM UTC-4, Ruby-

Re: [Rails] Re: SASS load path?

2016-03-19 Thread jim
No problem - glad you got it worked out! On Tuesday, March 15, 2016 at 9:43:06 PM UTC-4, Justin Stanczak wrote: > > OMG I'm just stupid. I just figured out what my issue is. All is working > fine, I just forgot to use the includes. Geez. Sorry for the waste of time, > and thanks for helping out.

Re: [Rails] Re: SASS load path?

2016-03-15 Thread jim
Interesting. Have you tried clearing Rails' tmp files with `rake tmp:clear`? I've seen that clear up weird asset-related issues. If that doesn't work, would it be possible to push your app to GitHub or somewhere public so I could take a look? If the code is private, you could potentially cre

[Rails] Re: remote:true with redirect. Does it make sence?

2016-03-15 Thread jim
The Rails guide has a great write-up on this: http://guides.rubyonrails.org/working_with_javascript_in_rails.html#form-for Essentially, remote: true will handle submitting your form via ajax for you, but it's on you to handle the response (since that's going to be very application-specific).

[Rails] Re: SASS load path?

2016-03-15 Thread jim
omponents, you can add it to the sass load paths (as you've done), and that should work after a server restart. Is your foundation.scss file in vendor/assets/components/foundation-sites/scss? Jim On Monday, March 14, 2016 at 9:55:20 PM UTC-4, Justin Stanczak wrote: > > >

[Rails] [JOBS] Rails Freelancer

2016-03-15 Thread jim
Hello! Room 118 Solutions (http://room118solutions.com) is a small web application consultancy specializing in Ruby on Rails. We’ve reached our capacity and we’re looking for a Rails freelancer to help us out. This would be an ongoing relationship with lots of growth potential. Technologie

[Rails] Re: search backwards in an one-to-many association

2016-01-14 Thread Jim
On Wednesday, January 13, 2016 at 12:13:36 PM UTC-5, Jim wrote: > > > If you want to load matching As without instantiating the Cs, you could do > something like: > > A.where(id: C.where(code: params[:codes]).pluck(:a_id)) > > If you are going to instantiate all As and Cs

[Rails] Re: search backwards in an one-to-many association

2016-01-13 Thread Jim
found_c = C.where(code: params[:codes]).includes(:a) found_a = found_c.collect(&:a).uniq Jim -- 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

Re: [Rails] DateTime Enumerator

2015-09-26 Thread Jim Ruther Nill
On Sun, Sep 27, 2015 at 4:41 AM, Colin Law wrote: > On 26 September 2015 at 19:29, Jim Ruther Nill wrote: > > hmm maybe relevant > > http://www.benknowscode.com/2014/02/ruby-date-time-range-intervals.html > > Thanks, if I interpret that correctly it is saying that what I a

Re: [Rails] DateTime Enumerator

2015-09-26 Thread Jim Ruther Nill
hmm maybe relevant http://www.benknowscode.com/2014/02/ruby-date-time-range-intervals.html On Sun, Sep 27, 2015 at 12:03 AM, Colin Law wrote: > Can someone explain this for me please? > > range = (DateTime.now..DateTime.now+1.hour).step(10.minute) > => # 17:41:18 +0100:step(600 seconds)> > 2.1.

Re: [Rails] Setting foreign keys, yet record.association_name returning nil

2015-09-05 Thread Jim Ruther Nill
On Saturday, September 5, 2015, Sadaf Noor wrote: > Also posted at stackoverflow: > http://stackoverflow.com/questions/32414734/setting-foreign-keys-at-rails-yet-record-association-name-returning-nil > > ( Please don't downvote ) > > > 2015-09-05 21:22 GMT+06:00 Sadaf Noor >: > >> Please help me

[Rails] Where is bootstrap gem for Rails 3?

2015-09-05 Thread Jim Morris
I'm trying to maintain a system written in Ruby 1.9.3 and Rails 3.2.13. My Gemfile.lock (retrieved from a working Heroku repo) calls for bootstrap-0.0.1, but I can't find it anywhere. I can't find any discussion on the web about this issue. How do I get a copy of it? -- You received this messa

[Rails] Re: Has anyone heard of this Ruby project?

2015-01-23 Thread Jim
ind it amusing that you are talking both about the trouble you are having understanding it, and also how you think it is cool and will be using it in your project. Too bad for the client, I suppose...maybe they like sprinkles in their coffee too. Jim -- You received this message becaus

[Rails] Re: mystery encoding problem sending email

2015-01-21 Thread Jim
s Mac OS X. A bit of googling has always helped me fix or work around any issues I might have had. Having the same Ruby environment in production as development is very helpful. Also, I would guess the email is being sent from a rake task? Any particular reason to use a launch daemon instead

[Rails] Re: Restrict Access to Create Action to Particular User Model?

2015-01-12 Thread jim
+1 for Pundit. I prefer it over CanCan these days, especially for your use-case. Jim On Thursday, January 8, 2015 at 3:02:47 PM UTC-5, Ruby-Forum.com User wrote: > > I have two user models one for businesses and one for buyers. How would > I be able to restrict the create method

[Rails] shifting to freelance

2014-12-17 Thread Jim Ruther Nill
Hi guys, I am Jim, a Rails developer from the Philippines. I worked as a remote developer for an Australia-based company for 4 years. I've started using Rails around May of 2008 so I have extensive knowledge of old Rails versions. I would like to try out being a full time freelancer s

Re: [Rails] e-commerce

2014-12-05 Thread Jim
ck may still not clear. Just like with checks, it takes a couple days for the checks to clear (or not), so you have to have business processes in place to reconcile against Authorize.net and not consider a payment actually paid until Authorize.net has cleared the check and put the money in you

[Rails] Re: Could not install Rmagick Gem in rails 4 (Ubuntu 13.04)

2014-11-21 Thread Jim
nothing to do with Rails of any version. Besides that, rmagick is compatible with Rails 4. The current repository is at https://github.com/gemhome/rmagick and all tickets should be placed there. Jim -- You received this message because you are subscribed to the Google Groups "Ruby o

Re: [Rails] Looking for Senior RoR developers for leading IaaS Software vendor

2014-11-07 Thread Jim Ruther Nill
Hi Gavin, you'll need to provide your email if you wish people to reply to you :) On Fri, Nov 7, 2014 at 5:01 PM, Gavin Marriott wrote: > Are you a skilled Ruby on Rails Developer? Then our client would love to > hear from you. > My client is a global Pre-IPO company with four offices worldwide

Re: [Rails] Using Dropbox in Rails

2014-11-01 Thread Jim Ruther Nill
I think I've tried the gem before but have since switched to the chooser solution since it was a lot easier to implement. In your case, since you want to save to the user's dropbox folder, just use the saver solution https://www.dropbox.com/developers/dropins/saver On Sun, Nov 2, 2014 at 7:07 AM,

Re: [Rails] One huge table or separate tables? design issue

2014-10-12 Thread Jim Ruther Nill
you can also run a task that archives past dates to a duplicate table since you'll rarely need them. maybe you can keep 1 month data in the table that you're writing to. this way, you won't have to worry about the exponential growth of the table you're always accessing. On Sun, Oct 12, 2014 at 7:

[Rails] Re: Ruby on Rails performance on lots of requests and DB updates per second

2014-10-08 Thread Jim
Interestingly, at just 1K votes per second sustained for 10 hours, you could record a vote for the entire population of California! At 2K/sec for 12 hours, you could record votes for every single person in California, Texas, New York, and Florida! As for the question at hand, depending on how

[Rails] Re: New Project needs push notifications

2014-10-03 Thread Jim
assenger and Apache, so the stack you're familiar with should work just fine. Jim -- 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 rubyonr

Re: [Rails] Re: Broken has_many

2014-08-20 Thread Jim
t in question, the object will not be updated until you reload it. Jim -- 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+u

Re: [Rails] Re: Broken has_many

2014-08-19 Thread Jim
nguage, using any framework. To be honest, I have written code that requires a reload where certain functionality is invoked. I have a callback on deleting a related many that modifies a value in the parent. However, that code really should be refactored such that the children are not destroye

Re: [Rails] Re: Broken has_many

2014-08-18 Thread Jim
I can remember (at least since rails 2.0.x). Scenarios where you would actually need to re-query the database *every time you access a relation* are rare. If you really need to, you have that option, but in no way should that be a default. Jim On Monday, August 18, 2014 12:29:06 AM UT

Re: [Rails] Getting started

2014-08-05 Thread Jim Tobin
To work in development mode, Apache isn't needed. Just run the Rails server: $ rails s Then your browser finds it: http://192.168.1.51:3000/blog Sent from my iPhone > On Aug 4, 2014, at 6:22 PM, McHenry wrote: > > OK, I am lost... > > I have installed both Ruby & Rails. > > $ ruby -v > ru

Re: [Rails] Scaling/optimizing a slow ruby on rails application.

2014-07-23 Thread Jim Ruther Nill
On Wed, Jul 23, 2014 at 10:59 AM, Michael Solovyov wrote: > Hi everyone, > > > > My name is Michael Solovyov and I'm the co-founder & CTO of a > rails-based start-up. We have built a product for other businesses to help > their users adopt their products. > > > > We've built the application, d

Re: [Rails] ruby on rails

2014-07-15 Thread Jim Ruther Nill
On Wed, Jul 16, 2014 at 1:13 AM, Carlo Giustinoni < carlo.giustin...@gmail.com> wrote: > this is the worst installation package I have ever encountered, I > installed using www.railsinstaller.org, I installed the VS2010 shell, > when I try to generate script for anew project I get this error > > S

[Rails] Re: Unable to set up Rails app by Apache on Mac OS X 10.9.3

2014-07-02 Thread Jim
, but apparently Passenger has issues if the "nobody" user owns the app. Jim -- 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 rubyon

[Rails] Re: Unable to set up Rails app by Apache on Mac OS X 10.9.3

2014-07-01 Thread Jim
Brew, then you do not want to list passenger as a requirement in your rails app Gemfile. Personally, I only list app-specific gems in the Gemfile, and leave out the server-specific details like Passenger. Jim -- You received this message because you are subscribed to the Google Groups "Rub

[Rails] Re: Unable to set up Rails app by Apache on Mac OS X 10.9.3

2014-07-01 Thread Jim
le" directive to have an incorrect path. When I do that, apache silently fails to start (i.e. nothing in the access or error logs). Jim Crate -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this grou

Re: [Rails] Unable to set up Rails app by Apache on Mac OS X 10.9.3

2014-06-28 Thread Jim
On Saturday, June 28, 2014 9:54:15 AM UTC-4, Scott Ribe wrote: > On Jun 28, 2014, at 7:20 AM, Jim > wrote: > > > In fact, the reason I started using the built-in apache was because I > got tired of MacPorts blowing away all my config files seemingly at random. > > Ug

Re: [Rails] Unable to set up Rails app by Apache on Mac OS X 10.9.3

2014-06-28 Thread Jim
because I got tired of MacPorts blowing away all my config files seemingly at random. Jim -- 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 rubyonr

[Rails] Re: Unable to set up Rails app by Apache on Mac OS X 10.9.3

2014-06-28 Thread Jim
via rbenv, it will be just fine installed with the system ruby. However, you will need the PassengerRuby directive so it knows where to find the ruby and gem set to use when it instantiates your project. Jim -- You received this message because you are subscribed to the Google Groups "Ruby on R

[Rails] Re: Unable to set up Rails app by Apache on Mac OS X 10.9.3

2014-06-24 Thread Jim
> and couldn't display http://localhost/most/rannumgenerator/index > (rannumgenerator is controller I generated in most project). > > Wonder if something that I should do for Mac Mavericks or some setting for > Apache that I am not aware? > You may need to look in your error log (probably

Re: [Rails] Morons in our midst (re: "important news")

2014-05-27 Thread Jim Ruther Nill
+1 I think it's not important news if Rails is gay or not On Wed, May 28, 2014 at 11:16 AM, Ken D'Ambrosio wrote: > Hi, all. I'm not a frequent contributor -- I'm just ramping up on Rails. > But I've been on the 'Net for quite some time. And back in the days of > yore, on Usenet, we had mode

[Rails] Re: QARoR - another Questions & Answers platform for Ruby on Rails

2014-05-03 Thread Jim Looker
Hi Mateusz, I want to contribute to this project. Can you pelase email me at juloo...@aol.com 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 rec

[Rails] Re: Having trouble overriding bootsrap-sass Gem css with GMaps API accesssed through Gmaps4Rails Gem

2014-04-26 Thread Jim Whittaker
I just tried this, again no luck :( -- 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+u

[Rails] Having trouble overriding bootsrap-sass Gem css with GMaps API accesssed through Gmaps4Rails Gem

2014-04-26 Thread Jim Whittaker
I am following the Gmaps4Rails tutorial and trying to implement it in a bootstrap framework, but am having problems. The map won't load correctly... See here: http://i.imgur.com/qMiczCe.png. Zooming in function does not work. I tried the workaround but it has only helped marginally. This appears t

[Rails] Re: Dependency drop down list

2014-03-05 Thread jim
their selection from the first select. It's not ideal, but it's a reasonable fallback. Jim On Tuesday, March 4, 2014 4:28:04 AM UTC-5, Ruby-Forum.com User wrote: > > Hello, > > I am trying load a drop down list based on selection from first > drop > down list.

Re: [Rails] How to get around a reserved word

2014-03-05 Thread Jim Ruther Nill
On Wed, Mar 5, 2014 at 9:32 PM, Walter Lee Davis wrote: > > On Mar 5, 2014, at 6:40 AM, Frederick Cheung wrote: > > > > > > > On Wednesday, March 5, 2014 7:02:34 AM UTC, Walter Lee Davis wrote: > > I need to use the model name 'Action' (which will not work in Rails > 4.0.3) for business reasons (

[Rails] Re: Coffee Script Sucks

2014-03-03 Thread jim
I was very resistant to it at first, as well. As it turns out, it was really for no good reason at all. After diving in and forcing myself to use it on a project, comparing that project's CS to an older project's JS sold me on using it forever. It's simply easier to read, more concise, and t

[Rails] Re: Access Control - Roles

2014-03-03 Thread jim
You can also check out Pundit (https://github.com/elabs/pundit). Jim On Monday, March 3, 2014 10:24:21 AM UTC-5, Rita Ferreira wrote: > > Hi, > I'd like to have your opinion/help in the following situation: > > I want to install a Gem to Access Control according to user roles

[Rails] Re: OT: buying a Mac computer

2014-03-01 Thread Jim
w APIs ahead of MacOS, so it is often nice when they are ported to the MacOS frameworks as well. Now that OS releases are on yearly schedules for both platforms there is much more parity between the frameworks. Jim -- You received this message because you are subscribed to the Google Groups &

[Rails] Re: ExecJS::RuntimeError in Say#hello

2014-02-24 Thread jim
It looks like this may help http://stackoverflow.com/a/14118913 Jim On Sunday, February 23, 2014 5:38:04 AM UTC-5, Askhat Bolatkhan wrote: > > Showing *D:/RailsInstaller/blog/app/views/layouts/application.html.erb* where > line *#6* raised: > > > module.js:3

[Rails] Re: Can two Rails versions use one database?

2014-01-31 Thread Jim
On Thursday, January 30, 2014 4:13:58 PM UTC-5, Russ S wrote: > So, we are searching for creative solutions to the upgrade problem. One > idea is to start rewriting the application in Rails 4 and run it alongside > the Rails 1 application. As features are added to the Rails 4 version, the > sam

[Rails] Re: rails and passenger memory issues

2013-12-05 Thread Jim
or may not help, since you don't know if they're still doing whatever caused them to use so much memory by the time you find them. Couldn't hurt to try, though. http://pivotallabs.com/inspect-running-ruby-processes-using-xray-and-kill-3/ Jim Crate -- You received this message

[Rails] grouped_collection_select for has_many :through Association not Updating

2013-11-07 Thread Jim Miller
I have a scenario where I created a few has_many :through associations which I am having trouble updating. I do appreciate any help! Thank you! Here is my setup: ruby 1.9.3p392 Rails 3.2.13 Here is the scenario: I have 3 models that are related There are many Industries, many

[Rails] Rails 4 - I got NoMethodError undefined method. Please help

2013-10-20 Thread Jim
I got a NoMethodError when i called <%= @post.admin_user.name %>, don't know how to fix it. Extracted source (around line #4): <%= @post.title %> <%= @post.body %> Post created at <%= @post.created_at.strftime('%b %d. %Y') %> <%= @post.admin_user.name %> Category: <%= lin

Re: [Rails] Asset pre-compilation unbearably slow: Have we outgrown asset pipeline?

2013-06-27 Thread Jim Ruther Nill
On Fri, Jun 28, 2013 at 12:11 AM, Bryan Migliorisi wrote: > Our application is a very large (read: "enterprise") Single Page > Application. > > Even though our app is 99% client side with a Java RESTful API, we built > the web application on top of rails because the Asset Pipeline seemed like > a

Re: [Rails] Looping through hash and sub-hash.

2013-06-19 Thread Jim Ruther Nill
On Thu, Jun 20, 2013 at 10:30 AM, Patrick Curl wrote: > # Need a little push in the right direction. > @prices = [ > "amazon_new" => [ > "image" => "imageurl.com", > "url" => "bookurl.com", > "price" => 45.55 > ], > > "amazon_used" => [ >

Re: [Rails] Paperclip thumbnail generation uses magic?

2013-06-12 Thread Jim Ruther Nill
I haven't seen the paperclip code but I think you can look at the preprocessors used by default by paperclip. You usually see logs when paperclip does some processing using rmagick which may be a clue as to what part of the lib you want to look at. On Wed, Jun 12, 2013 at 11:15 PM, Walter Lee Dav

Re: [Rails] Re: How to run view helpers from rails console?

2013-05-29 Thread Jim Ruther Nill
i think you can also use app for the url_helpers app.posts_path for example On Thu, May 30, 2013 at 2:21 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On Wednesday, May 29, 2013 10:25:59 PM UTC+1, Ruby-Forum.com User wrote: >> >> With >> > rails console --sandbox >> I cant tes

Re: [Rails] Why does Hash#values_at not working?

2013-04-30 Thread Jim Ruther Nill
p h.values_at[*ar] should be p h.values_at(*ar) On Wed, May 1, 2013 at 12:50 PM, Love U Ruby wrote: > While the below code working :- > > > m = {:a => 2, :b => 3,:c => 44,:g => 14} > a = [:a,:b,:g] > p m.values_at(*[:a,:b,:g]) #=> [2, 3, 14] > > why the below not working? > > h = { > 'arg0'

[Rails] Re: How to fit an ER model into Rails? (help an old procedural programmer)

2013-04-19 Thread Jim
d::Base scope :teachers, where(:person_type => 'Teacher') scope :students, where(:person_type => 'Student') end Then, you could get members, teachers, and students for teams like this: team.members team.members.teachers team.members.students Jim > > -- You received

[Rails] Re: Rails app + Apache Passenger + Postgres : memory consumption

2013-04-08 Thread Jim
0guide%20Apache.html#_resource_control_and_optimization_options Also, you can check the status and memory usage of your Passenger/Rails processes using the commands documented here: http://www.modrails.com/documentation/Users%20guide%20Apache.html#_analysis_and_system_maintenance Jim -- You received this message because you a

Re: [Rails] Re: Implementing Twitter's new Typeahead in Rails

2013-03-16 Thread Jim
would be: SubCategory.where("LOWER(name) like LOWER(?)", "#{params[:q]}%") Or, according to a bit of googling, this would automatically do a case insensitive query correctly for the current database: subcats=Subcategory.arel_table Subcategory.where(subcats[:name].matches("%#{params[:

[Rails] Re: Suggestions for my first serious Ruby on Rails project

2013-02-17 Thread Jim
I would do just like I've done for automated tasks in several other Rails apps I've written: make a rake task for it which can be triggered via cron job. The rake task can simply trigger a model method to do whatever needs done. This keeps all code relevant to the app in the application (and m

Re: [Rails] Running Rails App Via Passenger

2013-02-15 Thread Jim
On Thursday, February 14, 2013 5:31:38 PM UTC-5, Nick Apperley wrote: > > Managed to access the website by adding *Listen 1025* to the Apache > config file, and adding an entry to the hosts file. Have used a different > port for the website (in its VirtualHost entry). Port 80 is already taken >

Re: [Rails] joining 2 tables

2013-01-31 Thread Jim Ruther Nill
On Thu, Jan 31, 2013 at 9:52 PM, Fabian Peter wrote: > Hello, > > I'm trying to join 2 tables with ruby on rails 3.2. > > rails generate model product name:string > rails generate model price product_id:integer price:integer > date:datetime > > product.rb: > class Product < ActiveRecord::Base >

[Rails] Shameless plug

2013-01-30 Thread Jim Ruther Nill
Hey guys, If you have time to read something today, please visit the latest entry on NetEngine's blog. http://netengine.com.au/blog/learning-while-conducting-the-triggerapp-upgrade/ This will grant me a case of beer if I gain at least 60 views today. hehe Thanks! -- ---

Re: [Rails] case study

2013-01-30 Thread Jim Ruther Nill
use validates_associated and use a before_validation callback > > Le mercredi 30 janvier 2013 15:27:43 UTC+1, jim a écrit : >> >> >> On Wed, Jan 30, 2013 at 6:48 PM, oto iashvili wrote: >> >>> I want to do >>> @ad = Ad.attributes(params[:ad]) >>

Re: [Rails] Multiple forms to create multiple records for multiple users

2013-01-30 Thread Jim Ruther Nill
On Wed, Jan 30, 2013 at 5:34 PM, Abdullah Esmail wrote: > Hello. > I have come across a scenario where I need to save multiple records for > multiple users on the same page. > > User has_many :shifts > Shift belongs_to :user > > I need to show multiple shifts for each user on the same page and the

Re: [Rails] case study

2013-01-30 Thread Jim Ruther Nill
a getter and setter method for each kind of details that you want. If you don't want to do that, create an attr_accessor for the details, and create the detail record in a callback. > > > Le mardi 29 janvier 2013 13:39:18 UTC+1, jim a écrit : >> >> >> >> >

Re: [Rails] case study

2013-01-29 Thread Jim Ruther Nill
ing association records. Try to look into virtual attributes and callbacks. > > > Le lundi 28 janvier 2013 01:10:30 UTC+1, jim a écrit : >> >> >> >> >> On Mon, Jan 28, 2013 at 6:27 AM, oto iashvili wrote: >> >>> hi, >>> >>>

Re: [Rails] case study

2013-01-27 Thread Jim Ruther Nill
On Mon, Jan 28, 2013 at 6:27 AM, oto iashvili wrote: > hi, > > i' trying to re-create my project from php to rails. But now Im faced with > a pb to witch I had solution with php, but I cant figure how to make it > work with rails > > here my tables > > ads > id > category_id > title > text

Re: [Rails] Best practice to handle this

2013-01-26 Thread Jim Ruther Nill
On Sat, Jan 26, 2013 at 8:58 PM, Linus Pettersson < linus.petters...@gmail.com> wrote: > Hi! > > I have a model which has a field that can have three values only. I store > the value in the database as an integer, 0, 1 or 2, but when I display it I > want a more appropriate text. And, I want it to

Re: [Rails] group by + sum

2013-01-25 Thread Jim Ruther Nill
a concat of the values instead of simple addition. try hours.map { |h| h.hour.to_f }.sum > > How to? Do I also have to group otherwise..? > Thanks for support. > > > > > > > > > > > > > > > > > > > > > > > > > >

Re: [Rails] I am trying to add a block dynamically. I is giving an error saying “wrong no. of arguments”(1 for 2

2013-01-24 Thread Jim Ruther Nill
On Fri, Jan 25, 2013 at 3:47 PM, suchi gupta wrote: > <%render :partial =>'new_campaign_partial'%> > > > <%= link_to_function "Add a campaign" do |page| > inser_html :bottom, :new_campaign, :partial=>'new_campaign_partial' >end%> > If I remember correctly, link_to_function does not

Re: [Rails] Re: Add Multiple Records of a model using single form

2013-01-24 Thread Jim Ruther Nill
On Thu, Jan 24, 2013 at 10:49 PM, BalaRaju Vankala wrote: > Thank you @Werner its Working. > > > On Thu, Jan 24, 2013 at 7:59 PM, Werner > wrote: > >> something like that: >> >> *<% 1.upto(2) do |i| %> >> <%= text_field_tag "fields[#{i}][user_name]",'', :class => "user_name" %> >> <%= radio_butto

Re: [Rails] group by + sum

2013-01-24 Thread Jim Ruther Nill
On Thu, Jan 24, 2013 at 10:38 PM, Werner wrote: > Jim..sorry.. not my day... > have to contemplate about your solution. > > I wonder.. > > HourUser.includes(:user).where.group_by { |h| h.week_id } > > <% @hours.keys.sort.each do |h| %> > <%= @hour

Re: [Rails] group by + sum

2013-01-24 Thread Jim Ruther Nill
On Thu, Jan 24, 2013 at 7:55 PM, Werner wrote: > Hi Jim.. thanks so far.. > > in the moment this is a bit too far for me. > > > Just remember that to get a certain value, you'll have to pass an array as > the index > ie sums[[33,2]] to get 70 > => this is uncle

  1   2   3   4   5   6   7   >