Re: [Rails] Activerecord has_many custom method

2016-05-18 Thread BuyzLots
Have a look at rails scope. I’m pretty sure this is the functionality you are looking for. http://guides.rubyonrails.org/active_record_querying.html#scopes Basically, you define your association, then define a scope to

Re: [Rails] uninitialized constant SessionController

2016-04-03 Thread BuyzLots
your pointing your route to ‘session’ not ‘sessions’. It should be get ‘/login’ => ‘sessions#new, as: :login Matt > On Apr 3, 2016, at 5:14 PM, Rajinder Yadav wrote: > > I don't understand why I am getting the error "uninitialized constant > SessionController" when I use

Re: [Rails] helper function in database.yml not working from rake

2015-11-17 Thread BuyzLots
Why not just use an environment variable. For example, <%= ENV[‘MY_DB_PASSWORD’] %>. Then you can export that from your specific environment or fire up your task with the environment var set, ex: `MY_DB_PASSWORD=letsparty rails s` > On Nov 17, 2015, at 4:20 AM, ruud

Re: [Rails] Making rails-api (rails 4.0.2/9) work with strong parameters.

2015-07-24 Thread BuyzLots
Your payload looks like a string, is permit something you can call on a string object? On Jul 24, 2015, at 9:31 PM, Donald Ziesig don...@ziesig.org wrote: Hi All! I have been trying just about everything I can find on the web to make rails-api work with strong_parameters but no matter

Re: [Rails] Unpermitted params security warning

2015-05-26 Thread BuyzLots
try this: params.require(:receipt).permit(:store_id, :purchase_date, items_attributes: [:name, :amount, :unit_id, :quantity, :person_id, :project_id]) Matt On May 26, 2015, at 8:26 PM, GeorgeFromTheBank hext...@gmail.com wrote: Nobody knows about this seriously? On Sunday, May 24, 2015

Re: [Rails] No route matches /javascripts/eop-rails-external-vendor.js

2015-05-14 Thread BuyzLots
have you searched for 'eop-rails-external-vendor’.. if its in the js manifest it usually doesn’t have an extension on it. On May 14, 2015, at 9:36 AM, dasibre james.naad...@gmail.com wrote: Weird bug in my application when running in production. I precompile my assets, I keep getting No

Re: [Rails] Help with validation

2015-04-25 Thread BuyzLots
I don’t think you want your model validating another models attributes like this but to answer the question you could put in a return statement. return errors.add(…) On Apr 25, 2015, at 8:47 AM, Gm javapla...@gmail.com wrote: Hi, I'm trying to validate an array attribute

Re: [Rails] conditional layout question ? sidebar visible on all pages except the login page.

2014-08-13 Thread BuyzLots
you could use current_page with route to check the page. Ex: render sidebar unless current_page?(login_path) Matt On Aug 13, 2014, at 2:20 AM, Roelof Wobben rwob...@hotmail.com wrote: Hello, Allmost all pages have the same layout except the login page. There the sidebar with menu is not

Re: [Rails] To create a Ruby on Rails app, does back-end need to occur before front-end?

2014-05-23 Thread BuyzLots
I've handled projects both ways, If your Front end developer is not familiar with rails then I would have them create interactive mocks (all the interactions, etc but with static html) It's very easy for a developer to copy over the front end code and make the modifications so that it works

Re: [Rails] Soft Validation

2014-04-15 Thread BuyzLots
You might be able to utilize html5 validation, all depends on the requirements. http://diveintohtml5.info/forms.html#validation On Apr 15, 2014, at 2:06 PM, Michael Roess mike.ro...@gmail.com wrote: Hi all, Thanks for the suggestions. I was hoping to avoid client-side validations just

Re: [Rails] Issue with autocomplete jquery.

2014-02-14 Thread buyzlots
change: //= require_directory ./vendor to //= require_tree ./vendor On Feb 14, 2014, at 3:00 PM, James Davis, PhD james.davis...@gmail.com wrote: On Friday, February 14, 2014 4:21:58 AM UTC-6, Sridhar Vedula wrote: When I run my application in local machine the autocomplete functionality

Re: [Rails] [Need advice] Dynamic URL pointing at controllers action

2014-01-24 Thread buyzlots
You could do this with a param in the url… possibly MD5 the customer email. Then you can call some method to check it. Something like = render your_form if portfolio_customer?(params[:customer]) #then in the model. def portfolio_customer?(customer_key) customer_key ==

Re: [Rails] (Jobs) Berlin-based job openings for Ruby on Rails developers (f/m)

2013-07-03 Thread buyzlots
it was a bit odd. Male / female is usually implied :) On Jul 3, 2013, at 6:29 PM, Johnneylee Rollins johnneylee.roll...@gmail.com wrote: Oh, that's so odd. Is that just cultural or do opportunities usually advertise towards one gender over another? Are there jobs that are open to one

Re: [Rails] Link_to image_tag popup

2013-06-05 Thread buyzlots
Are you looking to open that link in a new tab? if so us :target = _blank… or are you looking for a lightbox style thing? If so checkout http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ its very easy to use. Matt On Jun 5, 2013, at 10:39 AM, Avi

Re: [Rails] Asset pipeline and jQuery scope

2013-05-09 Thread buyzlots
good to hear! Curious what was the issue? Matt On May 9, 2013, at 9:17 PM, Dave Castellano li...@ruby-forum.com wrote: Solved! -- 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

Re: [Rails] Asset pipeline and jQuery scope

2013-05-08 Thread buyzlots
Your coffeeScript looks fine, I don't think that error is in reference to that as your coffee references '#big_image' and not 'big_image_div' what is 'big_image_div'? On May 8, 2013, at 1:22 PM, Dave Castellano li...@ruby-forum.com wrote: Hi, I'm an amateur learning Rails, and having trouble

Re: [Rails] Asset pipeline and jQuery scope

2013-05-08 Thread buyzlots
also, could you create gist with your code? gist.github.com Matt On May 8, 2013, at 3:27 PM, buyzlots buyzl...@gmail.com wrote: Your coffeeScript looks fine, I don't think that error is in reference to that as your coffee references '#big_image' and not 'big_image_div' what

Re: [Rails] image_tag problem

2013-05-08 Thread buyzlots
I would use the inspector in the browser and see where the src is pointing to. That will give you a clue as to the path it is taking. Based on your email It **should be pointing to: src=/images/Smileimg2.jpeg. Also, checkout your image file name and make sure your casing is correct.

[Rails] Testing a helper that uses content_for

2013-04-13 Thread buyzlots
Hey guys, I'm having trouble testing a helper that uses content_for. I am using test::unit and hitting a road block. below is my code and below that is the error I am hitting. Any help would be much appreciated. Matt -- my helper def -- def page_title(title) content_for(:title) {