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

2019-06-06 Thread Arup Rakshit
I have a Project and Bid model. Project has_many :bids Bid belongs_to project I have now relation = Project.includes(:bids, :user).references(:users, :bids) What I now want is : select projects by ordering them with their bids count. How can I write this query? -- You received this message be

[Rails] Chartkick Stacked column help

2019-02-26 Thread Arup Rakshit
Hi, I am trying to create a stacked column chart like [this]( https://www.dropbox.com/s/db4tu7wsa5a9q7x/Screenshot%202019-02-26%20at%2010.00.27%20PM.png?dl=0) . But I am getting it like [this]( https://www.dropbox.com/s/ze89lckd4fv64ky/Screenshot%202019-02-26%20at%2010.33.49%20PM.png?dl=0). Can an

Re: [Rails] Issue with connecting to oracle database

2019-02-14 Thread Arup Rakshit
Hello, Please look into this documentation https://github.com/kubo/ruby-oci8/blob/master/docs/install-instant-client.md#windows . They mentioned what needs to be done when such error comes up. On Tue, Feb 12, 2019 at 8:01 PM shashank tiwari wrote: > The error is coming from my development compu

[Rails] cach invalidation help

2017-06-17 Thread Arup Rakshit
I have the below code: class ContactsController < ApplicationController # .. def top_3 cache_identifiers = { contact_1: 1, contact_2: 2, contact_3: 3 } cache_keys = cache_identifiers.keys cached_keys_with_values = Rails.cache.read_multi(*cache_keys) uncached_keys = cache_key

[Rails] How to cancel the Ajax form submission in Rails using Jquery ujs ?

2015-10-18 Thread Arup Rakshit
uot;names"=>"1", "name"=>"all@all", "user_ids"=>"1 2"}, "commit"=>"Save List", "id"=>"1"} Can't verify CSRF token authenticity Completed 422 Unprocessable Entity in 2ms (ActiveRec

Re: [Rails] Re: #link_to is throwing error - ArgumentError: arguments passed to url_for can't be handled.

2015-02-20 Thread Arup Rakshit
On Friday, February 20, 2015 12:06:34 AM Javix wrote: > > On Wednesday, 18 February 2015 18:46:54 UTC+1, Arup Rakshit wrote: > > > > Hi, > > > > I have the below resource table Comment controller : > > > > [arup@app]$ rake routes | grep comments >

Re: [Rails] #link_to is throwing error - ArgumentError: arguments passed to url_for can't be handled.

2015-02-19 Thread Arup Rakshit
e ticket for this. -- ==== Regards, Arup Rakshit Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. --Brian Kernighan -- You received this message because you

[Rails] #link_to is throwing error - ArgumentError: arguments passed to url_for can't be handled.

2015-02-18 Thread Arup Rakshit
ng ? I am not getting the result as guide promised. :-) -- Regards, Arup Rakshit Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. --Brian Kernig

[Rails] difference between in_groups and in_groups_of Rails

2014-11-01 Thread Arup Rakshit
Hi, I am not finding any difference between the 2 methods - in_groups and in_groups_of. Is their really any difference between in_groups and in_groups_of.. http://api.rubyonrails.org/classes/Array.html#method-i-in_groups. -- Regards, Arup Rakshit Debugging

Re: [Rails] Re: What is the actual use of ActiveRecord::SpawnMethods#except?

2014-07-06 Thread Arup Rakshit
ope* ? Will it be a good choice although to use scope relation if it fits any query, with some tailoring using *except* ? -- Regards, Arup Rakshit Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as p

Re: [Rails] Embarrassingly Simple Question

2014-07-05 Thread Arup Rakshit
> Try putting your root directive as the very last thing in the routes file. > That's where it belongs, as it's the last option possible. > > Walter > What is the logic behind it ? -- ======== Regards, Arup Rakshit Debugging is twice as ha

[Rails] What is the actual use of ActiveRecord::SpawnMethods#except ?

2014-07-05 Thread Arup Rakshit
g it again. This how the doco http://api.rubyonrails.org/classes/ActiveRecord/SpawnMethods.html#method-i-except is saying. -- Regards, Arup Rakshit Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly a

Re: [Rails] Re: Jquery code is not executed

2014-07-04 Thread Arup Rakshit
On Tuesday, July 01, 2014 04:28:48 AM and...@benjamin.dk wrote: > Hows the controller rendering the response? > > you might be missing a block like this on your controller action: > > respond_to do |format| > format.js do > end > end Here is the controller :- class CommentsController < Appl

[Rails] Jquery code is not executed

2014-06-29 Thread Arup Rakshit
Hi, Here is the views/articles/show.html.erb file <%= render @article %> Comments <%= render @article.comments %> <%= link_to "new comment", new_article_comment_path(@article, :format => :js), :remote => true, :id => 'new_comment_link' %> and views/comments/new.js.erb $("<%= escape_javascr

[Rails] TypeError (can't cast Enumerator to string): - Ruby on Rails

2014-05-26 Thread Arup Rakshit
ent_type` (0.1ms) rollback transaction Completed 500 Internal Server Error in 5ms TypeError (can't cast Enumerator to string): app/controllers/upload_controller.rb:8:in `save' == I am reading a book and trying out stuffs and got stuck here. My little tutorial is uplo

[Rails] Order (call 'Order.connection' to establish a connection)

2014-05-12 Thread Arup Rakshit
doing such manual connection establishment. -- Regards, Arup Rakshit -- 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

[Rails] What does assign method do in testing ?

2014-05-02 Thread Arup Rakshit
*assigns* - _Any objects that are stored as instance variables in actions for use in views._ (http://guides.rubyonrails.org/testing.html#the-four-hashes-of-the-apocalypse) I have a code :- test "should update line_item" do patch :update, id:@line_item, line_item: { cart_id:@line_item.cart_i

[Rails] Re: Rails where clause help

2014-02-18 Thread Arup Rakshit
Robert Walker wrote in post #1137052: > Robert Walker wrote in post #1137051: >> @users.where({ name: @request.requester, name: >> @request.regional_sales_mgr }).all >> >> Just note that this would never return any results since "name" can only >> have one value at a time. Sorry! for making you co

[Rails] Rails where clause help

2014-02-18 Thread Arup Rakshit
Hi, I found one answer from - http://stackoverflow.com/a/20198450/2767755 @users = User.where(name: [@request.requester, @request.regional_sales_mgr]).all Here @users will be having all those users, whose names are either `@request.requester` or `@request.regional_sales_mgr`. But what is the Ru

[Rails] Re: Hartl rails tutorial need help - regd "Test-driven development" introduction

2014-01-11 Thread Arup Rakshit
Max Maxwell wrote in post #1132841: > please post the test code you're trying to run. also, unless it's a lot > of > hth, > > Max Sorry! For the confusions. I expect it to fail. What made me confused is - *expected #has_content?("Sample App") to return true, got false*. Because the tutorial i

[Rails] Hartl rails tutorial need help - regd "Test-driven development" introduction

2014-01-10 Thread Arup Rakshit
Hi, I am getting some unexpected error which is not mentioned in the rails tutorials(http://ruby.railstutorial.org/chapters/static-pages#sec-TDD) I am following : (arup~>sample_app)$ bundle exec rspec spec/requests/static_pages_spec.rb F Failures: 1) Static pages Home page should have the co

Re: [Rails] RubyEval in SublimeText2

2013-06-02 Thread Arup Rakshit
Yes, that has been configured. but when pressed `super + k`. nothing comes. On Saturday, June 1, 2013 9:31:33 PM UTC+5:30, Ulises Cabanillas wrote: > > Super is Command-key on Mac and Win-key on PC. > > Additionally, verify if you have in Keys Preferences something like that: > { "keys": ["sup