[Rails] Re: Prime user table for the first user

2017-07-13 Thread Matt Jones
e the first. If you're worried about somebody racing to sign up for that first account, you'll want to come up with a more secure approach. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsu

[Rails] Re: One database and several users with different access rights

2017-07-12 Thread Matt Jones
www.2ndquadrant.com/en/resources/pglogical/ To replicate only the large table to per-user Postgres DBs. Definitely NOT an appropriate solution for multi-tenancy with lots of users, but neither is table-per-user. --Matt Jones -- You received this message because you are subscribe

[Rails] Re: Application with dynamically/custom fields

2016-04-07 Thread Matt Jones
d otherwise, but you may encounter odd behavior. * the data model doesn't seem quite right - custom_field_infos should have a contact_id column and a custom_field_id column (to indicate which contact & field this record has data for). It shouldn't need a user_id column unless

Re: [Rails] How to match a literal colon in a route

2016-03-02 Thread Matt Jones
uting of ARK URLs, you may want to consider writing your own Rack middleware to hijack the URL parsing process and transmute them into something more palatable to the existing router. --Matt Jones On Monday, 29 February 2016 20:21:19 UTC-5, Justin Coyne wrote: > > I'

Re: [Rails] adding descriptions to images displayed in bluimp image gallery

2016-03-02 Thread Matt Jones
t; >> > -- >> > 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-ta...@googlegroups.com.

[Rails] Re: How to get Rails Internal IP

2016-02-15 Thread Matt Jones
ecommend depending on that for anything like licensing or authorization since any data coming from JS is trivially spoofable. I'd recommend that you push back on whoever / whatever is imposing this requirement to figure out what the intent is. You may need to find an alternative way to a

[Rails] Re: rou

2016-02-12 Thread Matt Jones
On Tuesday, 9 February 2016 18:21:15 UTC-6, Ankit Raj wrote: > > > > On Wednesday, February 10, 2016 at 12:00:42 AM UTC+5:30, Matt Jones wrote: >> >> >> >> On Tuesday, 9 February 2016 12:20:37 UTC-6, Ankit Raj wrote: >>> >>> Hello geeks, >

[Rails] Re: rou

2016-02-09 Thread Matt Jones
You didn't show the controller code, but that's where I'd recommend you start looking. --Matt Jones -- 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,

Re: [Rails] Dynamic Fields and Models Architecture

2016-01-26 Thread Matt Jones
The query interface you're describing sounds a lot like Elastic (formerly Elasticsearch): https://www.elastic.co/products/elasticsearch --Matt Jones On Tuesday, 26 January 2016 02:19:23 UTC-6, Usman Shahid wrote: > > Parsing isn't the issue. The problem is that I don't

[Rails] Re: Has anyone setup Acts_as_Follower Gem Successfully?

2016-01-22 Thread Matt Jones
On Thursday, 21 January 2016 22:21:37 UTC-6, Ruby-Forum.com User wrote: > > Matt Jones wrote in post #1180578: > > On Tuesday, 12 January 2016 00:12:04 UTC-5, Ruby-Forum.com User wrote: > >> follow to unfollow. > >> > > I'm returning for

[Rails] Re: Polymorphic join table not loading with includes

2016-01-14 Thread Matt Jones
omments"."id" AS t1_r0, "comments"."content" AS t1_r1 FROM "posts" LEFT OUTER JOIN "post_artifacts" ON "post_artifacts"."post_id" = "posts"."id" AND "post_artifacts"."artifact_type" =

[Rails] Re: Has anyone setup Acts_as_Follower Gem Successfully?

2016-01-12 Thread Matt Jones
. I'd recommend you try that code and report back if there are problems you can't sort out. Lastly, adding a block button and unblock button. > Again, you'll get much better assistance here if you try things yourself first. If you want requirements turned directly into c

[Rails] Re: Get a username when using Devise and Omniauth

2015-12-30 Thread Matt Jones
github.com/plataformatec/devise/wiki/How-To:-redirect-to-a-specific-page-on-successful-sign-in#redirect-back-to-current-page-after-oauth-signin Based on the requirements you've described, one option would be to check on sign-in to see if a user has no username and redirect them to a page that

[Rails] Re: Covert Hijiri Date to Gregorian Date

2015-12-17 Thread Matt Jones
> > Thanks in advance > You may get more assistance if you post an example of the conversion code that's failing. I can't speak to the accuracy, but the gem at https://github.com/ecleel/hijri at least has tests. --Matt Jones -- You received this message because you are subscr

[Rails] Re: Failure to install or update any gem through Win CMD

2015-12-11 Thread Matt Jones
ubinius/rubinius/issues/2929#issuecomment-34701873 Can you run the script linked there and paste your output? Since this is (potentially) a networking issue, any information about your setup (system version, network config, any proxies in use, etc) would be useful. --Matt Jones -- You recei

[Rails] Re: create/unload runtime routes

2015-12-11 Thread Matt Jones
the whole solution, since it's going to be creating routes to controllers that either existed at application startup (in which case the routes could just be in routes.rb) or that are being conjured into existence at runtime (tricky, and likely to cause exciting thread-safety issues on some

[Rails] Re: Dynamic Links within a namespace

2015-11-09 Thread Matt Jones
d in the `link_to` documentation, but looking at the source it appears you can pass the same sort of thing you'd give `polymorphic_path` to get namespace routes. http://api.rubyonrails.org/classes/ActionDispatch/Routing/PolymorphicRoutes.html So something like `link_to([:admin, perso

[Rails] Re: Login modal using default rails ajax request not working with subdomains

2015-10-21 Thread Matt Jones
On Friday, 16 October 2015 03:37:03 UTC-4, Ruby-Forum.com User wrote: > > I am having a devise user model. > > To login I am using twitter-bootstrap modal.The modal is by default > hidden and shown only after an rails default ajax request is send to the > server. > > It works fine with localh

Re: [Rails] Code to be run on server start up

2015-10-20 Thread Matt Jones
right place for this. For reference or general curiosity, there's a detailed guide to the Rails initialization process here: http://guides.rubyonrails.org/initialization.html --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby o

[Rails] Re: Running a Ruby Script from Rails controller kills the rails server

2015-10-13 Thread Matt Jones
city as "; rm -rf / ; echo" you're going to have a very bad time, depending on your system's permissions. Prefer the multi-argument version of `system` whenever possible: system("command name", "arg1", "arg2", "arg3") In this form, the argume

[Rails] Re: Too many sessions in a rails 4 app.

2015-10-12 Thread Matt Jones
ust make the form use `GET` and the URL will have all the user's selections. This is also helpful for users who want to bookmark or share the filtered list, as the entire state of the view is encoded in the URL. --Matt Jones -- You received this message because you are subscribed to

[Rails] Re: Active Record has_one through

2015-10-08 Thread Matt Jones
vent can truly only have one artist, this structure is not needed. If an Event can have many artists, than a has_one isn't correct. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group

[Rails] Re: Could not find gem 'tzinfo-data (>= 0) x86-mingw32'

2015-10-08 Thread Matt Jones
em. > First off, don't post screenshots. They get hidden by default in the Google Groups interface, and they're just harder-to-read pictures of text you could have copied directly. Secondly, the first error message says: "Run `bundle install` to install missing gems." H

[Rails] Re: How to write code to search serialize object in rails3 with PG sql

2015-10-07 Thread Matt Jones
his should be a serialized field at all; one of the primary tradeoffs you make with serialized fields vs. storing the data broken out into related records is *searchability*. If you're going to be querying the values extensively, maybe an alternative approach within your DB is better - or per

[Rails] Re: ERROR: While executing gem (Errno::ECONNREFUSED) Connection refused - recvfrom(2)

2015-10-05 Thread Matt Jones
Ruby may have been installed without OpenSSL, the certificate that issued the one used by Rubygems.org may not be trusted by your machine, a proxy server along the way could be misconfigured. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby

Re: [Rails] Sorcery Activity loggings

2015-10-01 Thread Matt Jones
provide more specifics on how the application server and database server are set up? In particular, how long does it take for a simple `ping` to get from the application server to the database? --Matt Jones > Den fredag 25 september 2015 kl. 15:16:44 UTC+2 skrev Albert Ramstedt: >&g

[Rails] Re: reset association cache for polymorphism

2015-09-20 Thread Matt Jones
encil < ActiveRecord::Base has_many :products, as: :details_info end class Notebook < ActiveRecord::Base has_many :products, as: :details_info end ``` Given those models, if you retrieve a list of Product objects you should be able to access each one's `details_info` fr

[Rails] Re: how testing associated objects?

2015-09-02 Thread Matt Jones
in `block (3 > levels) in ' > > Finished in 1.23 seconds (files took 2.81 seconds to load) > 3 examples, 1 failure > Failed examples: > rspec ./spec/controllers/polls_controller_spec.rb:14 # PollsController > GET #index assigns polls as @polls > > > as you

[Rails] Re: importing .csv file from user and storing data of csv into database using ruby on rails.

2015-08-27 Thread Matt Jones
o possible that these were adding while composing the email. > if @question.count == 1 > @question.first.update_attributes(question_hash) > else > Question.save!(question_hash) > What is the intent of this line? Are there situations where you can have multiple `Question` record

[Rails] Re: SSH/VNC/RDP Client Gems

2015-08-24 Thread Matt Jones
vailable to the *server*, which may be a deal-breaker if you're trying to build a service for people to connect to third-party SSH hosts. There are similar projects for RDP: http://guac-dev.org/ But again, this is a "JS frontend to server-installed software" approach, not entirely cl

[Rails] Re: Arabic text showing not properly in the file of s3

2015-08-24 Thread Matt Jones
V setting the correct encoding? Corrupted data earlier in the process will generally be passed straight through subsequent steps, so troubleshooting starting from the end (the CSV file on S3) is going to be difficult. --Matt Jones > On Friday, 21 August 2015 15:55:00 UTC+4, Matt Jones w

[Rails] Re: Arabic text showing not properly in the file of s3

2015-08-21 Thread Matt Jones
dy corrupted in the CSV. The text you've pasted looks like the result of double-encoding the names in UTF8. For instance, the first two characters: ا are codepoints U+D8 and U+A7. Together, those two bytes (read as UTF8) make up the single character U+0627 (ARABIC LETTER ALEF) which is w

[Rails] Re: I am new to Rails and Cucumber. Can someone help me with the error below?

2015-08-20 Thread Matt Jones
equire': cannot load such file -- sqlite3/sqlite3_native > (LoadError) > > The sqlite3 gem also requires a native SQLite3 driver to be installed. See this post for possible solutions: http://stackoverflow.com/questions/15480381/how-do-i-install-sqlite3-for-ruby-on-windows --Matt Jones

[Rails] Re: how to find what all associations have dependent: destroy associated with them from a concern

2015-08-20 Thread Matt Jones
s[:dependent] # do something with it end end ``` --Matt Jones -- 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..

[Rails] Re: Why does rake behave differently in production

2015-08-20 Thread Matt Jones
to be used in development? > :environment should work everywhere - I've been using it in production rake tasks for years. Can you be more specific about how the task was "not working as expected"? If it failed to start, what was the error message? Try running it with `--trace`

[Rails] Re: Upgrading from rails 3.0 to 3.2

2015-08-20 Thread Matt Jones
actually trying to use execute the following statement when this > error happened. > ActiveRecord::Base.connection.column_exists? klass.table_name, :user_id > > Any ideas on work arounds > > That version of attr_encrypted is fairly old, but I don't think it's the

[Rails] Re: Downgrading from Ruby 2.1.6 to Ruby 1.8.7

2015-08-20 Thread Matt Jones
ing the application is much trickier. If none of those arguments work, at least post the name of the company on here. I'd like to make sure I never give them my credit card number... --Matt Jones Could anyone help us? Is there any other tool to do the migration from > 2.1.6 to 1.8.7.

[Rails] Re: How to preserve the session id whether the http request header contains 'Pragma'='no-cache'.

2015-08-05 Thread Matt Jones
;Pragma'='no-cache'. > I can't find much documentation for Protected View, but there's some indication that it may be fiddling with the context that the web request uses when you click on the link: https://onmessages.wordpress.com/2015/01/19/a-security-problem-has-occur

[Rails] Re: Helps us with your feedback

2015-08-05 Thread Matt Jones
On Wednesday, 5 August 2015 06:50:50 UTC-4, tomcoo...@gmail.com wrote: > > Hey there > > We are dev team building outsource projects. And each time finishing the > projects we've had a pain with configuring backups (files and DBs) for our > customer's VPS. > > Honestly, I think that you, guys,

[Rails] Re: Restclient error

2015-08-05 Thread Matt Jones
enssl/ which will walk through how to troubleshoot this. --Matt Jones -- 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..

[Rails] Re: Net::SMTPSyntaxError (501 Sender syntax err$ Heroku

2015-08-03 Thread Matt Jones
ntain any unwanted characters, and if it has dashes in it make sure they haven't been converted to Unicode ones by a "helpful" autocorrect. You may want to reach out to Postmark's support and see if they can provide additional insight from their logs. --Matt Jones -- You r

[Rails] Re: How to save double-byte characters in mongodb?

2015-07-19 Thread Matt Jones
tor, or that it is saved incorrectly to the database? I was able to produce a string that looks (to my thoroughly-unfamiliar-with-Telegu-script eyes) like your "spelling goes wrong" example by replacing the last six bytes of the string with two literal periods (codepoint U+2E). --Matt

[Rails] Re: Re: Re: Re: Re: Re: Re: Migrating a complete Ruby rails app off heroku!

2015-07-09 Thread Matt Jones
it'd make the world a better place. There is a > quick and fast (and yes dirty) way to get stuff going. Not everything's > gotta be perfect and "As it should be" see... > BTW, I've got a Windows 1.0 app that I need to recompile for Windows 10. I need you to tell

[Rails] Re: why rails new xx failed on win7 x64?

2015-05-28 Thread Matt Jones
try these troubleshooting steps: https://gist.github.com/luislavena/f064211759ee0f806c88 --Matt Jones -- 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 emai

[Rails] Re: NoMethodError (undefined method `sismember' for nil:NilClass)…Trying to deploy on heroku

2015-05-28 Thread Matt Jones
; ApplicationController > > def index > @movies = Movie.all > end > > def show > @movie = Movie.find(params[:id]) > @cart_action = @movie.cart_action current_user.try :id > end > > end > > The weird about this error is that the applic

[Rails] Re: tinyint(1) and boolean

2015-05-21 Thread Matt Jones
On Sunday, 10 January 2010 14:57:15 UTC-5, Matt Jones wrote: > > On Jan 9, 6:16 pm, codeinnova wrote: > > So i had a boolean attribute in my model which gets interpreted to > > tinyint(1) in mysql by rails migrations. Now tinyint(1) accepts a > > range in mysql and i w

[Rails] Re: Can I use different version of action mailer

2015-05-15 Thread Matt Jones
this, but make SURE you've patched the JSON parser to close these holes: CVE-2013-0156: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-0156 CVE-2013-0333: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-0333 I doubt these are the only security vulnerabilities in 2.0.5, but t

[Rails] Re: action mailer settings and dkim signing

2015-02-18 Thread Matt Jones
tie::Configuration describes after_initialize as the "last configurable block to run, called after frameworks initialize". ActionMailer's own initialization routine copies the values from config.action_mailer *before* the code above sets them. So the behavior you've described makes

[Rails] Re: people are yelling, why?

2015-02-05 Thread Matt Jones
nd ended the method. when defining the method, I put @document = > Document.paginate(:page => params[:page]) and the shit just broke. > > The hardest error to debug remotely is "shit just broke". What happened? What error message do you get when you access that route th

[Rails] Re: Need opinions on a Rails app as a framework

2015-01-19 Thread Matt Jones
the Warbler community, as they've got experience deploying applications in a self-contained method as you've described. I'd also recommend pushing back on the "absolutely no install" requirement; what's the motivation? It seems to me like there's not much space betwee

[Rails] Re: Full Time Job :: Sr. Ruby On Rails Developer (San Francisco, Oakland)

2015-01-19 Thread Matt Jones
; *Salary : $100k- $150k + benefits* > Not to tell you how to do your job, but that salary range would be borderline when recruiting a senior dev here in the Midwest - and probably gets more lolz than responses in the Bay... --Matt Jones -- You received this message because you are subscribed to

[Rails] Re: Link To New Association

2015-01-14 Thread Matt Jones
_id". To do this in the routes file, you'd have something like: resources :patients do resources :hospitalizations end You can make a link to the new page with something like (in an ERB template): link_to "New Hospitalization", new_patient_hospitalization_path(@patient) assuming yo

[Rails] Re: An error occurred while installing ruby-oci8 (2.1.7)

2015-01-01 Thread Matt Jones
Set the environment variable ORACLE_HOME > if Oracle Full Client. > build 29-Dec-2014 15:13:05Append the path of Oracle client > libraries to LD_LIBRARY_PATH if Oracle Instant Client. > > As the messages here indicate, you need to set either ORACLE_HOME or add the cli

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

2015-01-01 Thread Matt Jones
rs. But of > course we have to wonder, what is the nature of this project? > > Sock puppets gotta sock, yo. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop re

[Rails] Re: Ruby code Injectors: Closures as Modules: Jackbox

2015-01-01 Thread Matt Jones
tstanding > customer service. > Bullshit. So far, your "customer service" has included shipping a gem that couldn't even LOAD SUCCESSFULLY. Take your spam to some other group. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Ra

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

2014-12-26 Thread Matt Jones
On Friday, 26 December 2014 17:56:39 UTC-5, Matt Jones wrote: > > > > On Sunday, 21 December 2014 15:55:26 UTC-5, Star Light wrote: >> >> https://github.com/LouHenryAlvarez/jackbox >> >> If it's true. It sounds like some pretty wild stuff. Anyone care t

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

2014-12-26 Thread Matt Jones
e's some interesting ideas in there, but nothing interesting enough that I'd want to bring un-debuggable, un-updatable mystery code in that also locks me to MRI. The barrage of "announcement" posts across rails-talk, ruby, ruby-dev, and ruby-core certainly haven't helped

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

2014-12-22 Thread Matt Jones
I've run across this, which is pretty remarkable for a project that currently contains specs but no implementation. ALL ABOARD THE HYPE TRAIN As to the functionality, an awful lot of what's proposed there sounds like things you could do more clearly using modules / concerns directly. H

[Rails] Re: puts command prints nothing !!!

2014-12-22 Thread Matt Jones
ng but i tried many ideas until i came here > This can happen when using tools to run code directly from your editor; some of them don't show the output of the command. Try running your code directly from your platform's command line. --Matt Jones -- You received this message becau

[Rails] Re: Slow json rendering

2014-12-16 Thread Matt Jones
the last one. If you've got 2000 resorts and each one has 100 reports or so, that means instantiating 20 SnowReport objects, and that is not going to be fast. --Matt Jones > json.st resort.try(:snow_reports).last.try(:snow_summit) if > resort.snow_reports >

Re: [Rails] RoR Associations - has_many :through valid or invalid usage?

2014-12-11 Thread Matt Jones
oad As together with the corresponding Cs using `include`: a_ids = [1,2,3,4] # presumably you start with ids, or some other data sufficient to find records all_the_as = A.include(:cs).find(a_ids) # this loads the specified A records, together with all their corresponding C records The above

Re: [Rails] Re: user stores - how to setup in theory

2014-12-11 Thread Matt Jones
ervice: https://stripe.com/connect Paypal may have something similar. --Matt Jones > On Wed, Dec 10, 2014 at 6:30 PM, Norm Scherer > wrote: > >> Sounds like an opportunity to blaze a trail! >> >> Norm >> >> >> On 12/10/2014 02:57 PM, tom wro

Re: [Rails] Bundle Install Fails on SSL connect for Rake gem

2014-12-11 Thread Matt Jones
07/ruby-openssl/ If you're on another OS, check into what you need to do to update the CA cert bundle in the operating system. The underlying issue is that the OpenSSL library can't validate the certificate rubygems.org is sending. --Matt Jones > On Monday, December 8, 2014 3

[Rails] Re: Why does this test fail.

2014-12-08 Thread Matt Jones
es a `CurrentCart` module, but is named `current_card.rb`. Fixing that makes all the tests pass. --Matt Jones -- 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,

[Rails] Re: Active Record - Null Forms for nil primitives and associations

2014-11-30 Thread Matt Jones
" into existence when referenced, as in the user profile thing: class User < ActiveRecord::Base has_one :profile def profile super || build_profile end end With this, you can happily refer to `@user.profile` and either get the existing record or a newly-instantiated one. If yo

[Rails] Re: activerecord : undefined method stringify_keys error

2014-11-26 Thread Matt Jones
y changes > *Ec.update(existing.id <http://existing.id>, to_store) > //Errror line* > And then `update` is expecting a hash, not an Array - giving the error you've noted. You may want `find` instead of `select` when extracting an instance's

[Rails] Re: locals with partial

2014-11-24 Thread Matt Jones
- name, value, and options. http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-hidden_field_tag In your case, it would look like: <%= hidden_field_tag :club_id, club_id %> The third argument is omitted, since you're only looking to set name, id and val

[Rails] Re: Any reason to use minitest instead of Rspec

2014-11-21 Thread Matt Jones
ng on can also be confusing to people who've never encountered it before. --Matt Jones -- 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 ru

[Rails] Re: date_select -> params ok but nil

2014-11-20 Thread Matt Jones
;"Create"} > > --> why are my event date attributes nil/blank? The date is not sent as a single attribute, but rather one per dropdown that date_select sends (thus from_date(1i) etc). When those attributes are assigned to your model, they are combined into a s

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

2014-11-14 Thread Matt Jones
features of AR, and confounding that by over-metaprogramming is going to obscure things further. Even re-opening the Post class in award_one.rb and adding the callback in the standard style would be clearer than this, but I'd recommend just using the version you've already wr

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

2014-11-13 Thread Matt Jones
at app.ecwid.com implement some kind of licensing? Some SaaS products will check the Referer header and deny access to requests coming from unlicensed domains that aren't "localhost". --Matt Jones -- You received this message because you are subscribed to the Google Group

[Rails] Re: Getting doublets of records while using an offset

2014-11-05 Thread Matt Jones
per(24)end > # Notice! Rube is so cool you can directly convert a uniqifyed number like > thisnumber = MY_UNIQ_STRING.to_i > > > not so elegant > any suggestions are welcome > > Are you on Postgresql? It takes a very literal interpretation of the SQL standard when row order

[Rails] Re: form_for not passing id?

2014-11-03 Thread Matt Jones
lt;% end %> > > @profile contains # as it should. > > routes contains: resources :profiles and the resulting routes appear OK > > >From the route it's generating, I suspect you have a `resource :profile` someplace above this. That matches the controller actions you

[Rails] Re: has_many through association on unsaved objects

2014-10-31 Thread Matt Jones
g me all projects not depending on whether I create the > join object by myself or not? Or how can I make AR aware of this? > > `u.projects` is going to load things from the database if the record is saved, but otherwise it will only return objects you've explicitly stored in it. The

Re: [Rails] rails version and copying app

2014-10-31 Thread Matt Jones
0.0) > atomic (1.1.13) > bigdecimal (1.1.0) > builder (3.1.4) > bundler (1.3.5) > i18n (0.6.5) > io-console (0.3) > json (1.5.5) > minitest (4.7.5, 2.5.1) > multi_json (1.7.9) > mysql (2.9.1) > rake (0.9.2.2) > rdoc (3.9.5) > thread_safe (0.1.2)

[Rails] Re: Need Quality E-Commerce Samples

2014-10-30 Thread Matt Jones
ils? > +1 to the existing recommendations for Spree and Shopify. But seriously, the premise is fairly silly: the toolset used to build a site has a minimal to nonexistent effect on its external appearance. It would be like asking a (building-style, not software-style) architect "I'm thin

[Rails] Re: Creating multiple views for a database table .. routing not working

2014-10-29 Thread Matt Jones
igger problem here is route order. You're getting this behavior because you have the route that matches `/foodsIlike/:id` is *before* the one that matches `/foodsIlike/user_list` in config/routes.rb --Matt Jones -- You received this message because you are subscribed to the Google Group

[Rails] Re: Radio button required field class

2014-10-17 Thread Matt Jones
lin said - there's not a single "element" for radio buttons. You didn't state which Javascript library you're using, but presumably it has a solution for radio buttons. Also note that the ability to not have any of them checked is widely supported among browsers but n

[Rails] Re: Ruby on Rails (ROR) Development Services

2014-10-17 Thread Matt Jones
; > To get more information please visit our website @ > > Tell your website people that *bolding random words* isn't worth pagerank, if it ever was... --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gr

[Rails] Re: ActiveSupport::Concern small question

2014-10-12 Thread Matt Jones
cluded(base) >> base.new.hello >> end > > > Both code get same error ( see above ) > `self.included` is Ruby's built-in hook. ( http://www.ruby-doc.org/core-2.1.3/Module.html#method-i-included ) It gets called when the module that declares it is included in another modul

[Rails] Re: display ppt file in rails application

2014-10-10 Thread Matt Jones
y, can only read PPT files that work in LibreOffice. One gotcha: none of these will replicate any of the more complex behaviors (animations, transitions). ruby_powerpoint doesn't even give text style info back, just text and images. --Matt Jones -- You received this message because you a

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

2014-10-09 Thread Matt Jones
ing a hyper-scalable DB layer isn't going to do much good until you're sure the layers in front of it (app servers, etc) can handle the load. You may also want to consider what part of these results needs to be durable. For instance, if an exact "user -> vote" mapping

[Rails] Re: Instance variable looses value upon render

2014-10-09 Thread Matt Jones
s wrong? > > When you call `render` the render happens immediately. If you return from an action *without* rendering or redirecting, the default behavior will be executed by ActionPack (rendering the template with the same name as the action). --Matt Jones -- You received this message beca

[Rails] Re: How to avoid N+1 queries in Rails "each" loops?

2014-09-30 Thread Matt Jones
ck a hash with `project_id`s as keys and the number of matching tasks as values. * `size` is the middle: if the collection is loaded, it works like `length`. Otherwise it works like `count`... --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: Couldn't find 'migration' generator

2014-09-25 Thread Matt Jones
ration AddwebToDistributors website:string > > But I am getting a error, saying that "Couldn't find 'migration' > generator" > > Try running the generator without arguments and report what you get back: ruby script/generate "migration" should be i

[Rails] Re: Rspec Active Record Problem

2014-09-25 Thread Matt Jones
elegates the `where` method to `all`. Normally this is a class method that returns a Relation object. Does your X class have an `all` class method that's overriding that? --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" g

[Rails] Re: Migration Trouble

2014-09-19 Thread Matt Jones
t; > > Any ideas why this one migration has problems? > > If you do `Membership.first` in the console, what happens? Usually when this sort of weirdness happens to me, it's because some other class/module in the app is getting named `Membership`, which makes a real mess. --Matt Jo

[Rails] Re: void value expression on model

2014-09-16 Thread Matt Jones
> 0 > players > Completed 500 Internal Server Error in 114ms > > SyntaxError > (C:/site/app/models/player.rb:48: voi > d value expression): > app/controllers/game_controller.rb:11:in `create' > > This is not a runtime error, this is a syntax error in `app/

[Rails] Re: Attr Accessor in Rails 4

2014-09-09 Thread Matt Jones
- it's a core Ruby function: http://www.ruby-doc.org/core-2.1.2/Module.html#method-i-attr_accessor You may be referring to attr_accessible, which has been removed to the protected_attributes gem in Rails 4: https://github.com/rails/protected_attributes --Matt Jones -- You received t

[Rails] Re: How to use a variable in several controllers?

2014-09-05 Thread Matt Jones
in one won't have any effect on subsequent requests. You may want to look into the built-in `session` helper, which uses signed cookies: http://guides.rubyonrails.org/action_controller_overview.html#session The Guides site overall will be very useful to you. --Matt Jones -- You received this message be

[Rails] Re: Redirect to same server with different port

2014-09-04 Thread Matt Jones
) "http://#{request.host_with_port}/#{path}"; } See the docs for ActionDispatch::Routing::Redirection for more info. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and sto

[Rails] Re: Token authenctication

2014-09-04 Thread Matt Jones
? > > Some info on token_authenticatable, direct from Jose Valim: https://gist.github.com/josevalim/fb706b1e933ef01e4fb6 A gemified version of it, recently extracted: https://github.com/baschtl/devise-token_authenticatable I've used the Gist version in a production app. --Matt Jones

Re: [Rails] Rails 2.3.5 Implementing Google Tag Manager

2014-09-03 Thread Matt Jones
ble. http://makandracards.com/makandra/16951-upgrading-rails-2-from-2-3-8-through-2-3-18-to-rails-lts --Matt Jones -- 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

[Rails] Re: Output of *_path not html_safe?

2014-09-02 Thread Matt Jones
glucose_readings_path(:hello => true, :goodbye=> false).class > => String < Object > > >> foo.link_to "hi", app.glucose_readings_path(:hello => true, :goodbye=> > false) > => "hi" > > This is the correct way to format links with &

[Rails] Re: Left Outer Join with multiple tables and group by counts

2014-08-27 Thread Matt Jones
e info here: http://guides.rubyonrails.org/association_basics.html#counter-cache Using counter caches in your example will mean adding a `comments_count` and `likes_count` column to your cuusers table. Then your scope could just use `where` to compare them... --Matt Jones -- You rec

[Rails] Re: How to solve can not redirect to nil error?

2014-08-20 Thread Matt Jones
l { redirect_to @line_item.expensescounter } #line no. : > 54 > . > . > . > . > . > end > > How can I solve this problem? > > Any help would be appreciated. > > You're going to need to figure out why @line_item.expensescounter is nil. Post the cod

[Rails] Re: Broken has_many

2014-08-18 Thread Matt Jones
as a serious bug, at least as a > configuration default. > > > The cleanest way to deal with this is to *use* the association. Instead of: tc = TestChild.new(:name => "test4", :test_parent_id => tp.id) do: tp.test_children.new(:name => "test4") This will

[Rails] Re: Rails 2.3.5: Trouble passing params to controller method through link_to tag

2014-08-11 Thread Matt Jones
to pick up the client-side checkboxes. This code: :employee.id => params[:retrieve_case[]]}, { :class => 'submit_button' }, :method => 'post' doesn't make any sense. I'd recommend getting this form to work with a real submit button and without AJAX *before* com

[Rails] Re: Calling link_to from rake task

2014-08-10 Thread Matt Jones
pers will be available there. You'll also want to make sure you set `default_url_options`: http://guides.rubyonrails.org/action_mailer_basics.html#generating-urls-in-action-mailer-views otherwise all your links will be missing the host part. --Matt Jones -- You received this message beca

[Rails] Re: Rules Engines

2014-08-10 Thread Matt Jones
any chance at invoking OpenRules from Ruby, this is likely it. * read up on invoking Java code from JRuby. This is a good start: https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby * last but should be done first: ASK SOMEBODY. It's possible that all the above have been addressed by in

  1   2   3   4   5   6   7   8   9   10   >