Ruby on Rails Friday, January 31, 2014

Oh, I think I see. In production ONLY it condenses them all down to a single file? Just realized now.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/119e0842-096e-48f2-9d67-8c70e7be6a63%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Actually I've changed the whole thing to:

def index
  @account = current_user.accounts.find_by_id(params[:account])
  @transactions = @account.transactions;
end

.. works fine





On Saturday, 1 February 2014 14:45:25 UTC+9, Bizt wrote:
Aaargh!!! I see it, I didn't type "account" correctly. I thought I was using the method incorrectly. How did I not see that for so long?!

@account = Users.accounts.find_by_id(params[:accoount])


This now works - @account = current_user.accounts.find_by_id(params[:account])





On Saturday, 1 February 2014 13:29:50 UTC+9, jainvi...@gmail.com wrote:
Please, try Users instead of current_user, like :
def index 
  @account = Users.accounts.find_by_id(params[:accoount])
  @transactions = @account.transactions.find_all_by_account(params[:accoount]);
end


On Sat, Feb 1, 2014 at 9:29 AM, Bizt <marty...@gmail.com> wrote:
Btw, I get the following error:

undefined method `transactions' for nil:NilClass


To me this tells me that @account if not found, or is returning an empty array. Am I using the wrong method, or parameters?

--
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.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fd67df38-8b15-46ae-9f72-2c94068c12fb%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Thanks & Regard
   Vikram Jain
=============

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/588896a9-abaa-4b30-9d4b-5d389b89115e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Aaargh!!! I see it, I didn't type "account" correctly. I thought I was using the method incorrectly. How did I not see that for so long?!

@account = Users.accounts.find_by_id(params[:accoount])


This now works - @account = current_user.accounts.find_by_id(params[:account])





On Saturday, 1 February 2014 13:29:50 UTC+9, jainvi...@gmail.com wrote:
Please, try Users instead of current_user, like :
def index 
  @account = Users.accounts.find_by_id(params[:accoount])
  @transactions = @account.transactions.find_all_by_account(params[:accoount]);
end


On Sat, Feb 1, 2014 at 9:29 AM, Bizt <marty...@gmail.com> wrote:
Btw, I get the following error:

undefined method `transactions' for nil:NilClass


To me this tells me that @account if not found, or is returning an empty array. Am I using the wrong method, or parameters?

--
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.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fd67df38-8b15-46ae-9f72-2c94068c12fb%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Thanks & Regard
   Vikram Jain
=============

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5bfa1106-2f3e-4bd1-9e86-5b0bad63920d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Please, try Users instead of current_user, like :
def index 
  @account = Users.accounts.find_by_id(params[:accoount])
  @transactions = @account.transactions.find_all_by_account(params[:accoount]);
end


On Sat, Feb 1, 2014 at 9:29 AM, Bizt <martyn.biz@gmail.com> wrote:
Btw, I get the following error:

undefined method `transactions' for nil:NilClass


To me this tells me that @account if not found, or is returning an empty array. Am I using the wrong method, or parameters?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fd67df38-8b15-46ae-9f72-2c94068c12fb%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Thanks & Regard
   Vikram Jain
=============

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJP0RPw%3Du9SEmDnwqNZ27MJ91OLDCPX_5X0TqpcZ_PBzZD%3DRMg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Btw, I get the following error:

undefined method `transactions' for nil:NilClass


To me this tells me that @account if not found, or is returning an empty array. Am I using the wrong method, or parameters?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fd67df38-8b15-46ae-9f72-2c94068c12fb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I have three tables: users, accounts, and transactions. Users have many accounts, accounts have many transactions. So I define my models like so:

class User < ActiveRecord::Base
  has_many :accounts, dependent: :destroy
end

class Account < ActiveRecord::Base
  belongs_to :user
  has_many :transactions, dependent: :destroy
end

class Transaction < ActiveRecord::Base
  belongs_to :account
end

Ideally on my app. When the current_user (btw, I'm also using Devise ;) clicks shows accounts, then clicks an account to show transactions for that page - eventually I end up on /transactions?account=2 URL. Until here works fine.

In my transactions controller, however, I was to display on that page transactions for that user (current_user) for that account (id=2). I'm not sure the correct way to do this thought. Below is what I was trying:

def index
  @account = current_user.accounts.find_by_id(params[:accoount])
  @transactions = @account.transactions.find_all_by_account(params[:accoount]);
end

..but it doesn't work :( Where am I going wrong?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d68efa8e-dc09-4bb1-b84f-8ab71888bfe8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,

I've installed twitter-bootstrap-rails to my app but when I view the source code I see.

<script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-transition.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-alert.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-modal.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-dropdown.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-scrollspy.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-tab.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-tooltip.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-popover.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-button.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-collapse.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-carousel.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-typeahead.js?body=1"></script>  <script data-turbolinks-track="true" src="/assets/twitter/bootstrap/bootstrap-affix.js?body=1"></script>


Is there something about rails assets in that it condenses all these together in a single file to improve performance (fewer files to download).  Why is this not happening here? Shouldn't it be, or have I not set something?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/34e2f302-b909-40e7-9c2e-08f0a219cf3a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Thanks for your reply. Can you tell me what "git add -u" does, I can't find documentation for that specific option. Thanks

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/907dc23d-7d93-4bd6-9297-8783ed3e8fce%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Is this what you're looking for?

selected_objects.map do |obj| {"scholarship" => obj} end.to_json

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/df6bc70baca4f7610fcfa70c088d0621%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Use 'git add -u' or add the specific files you've removed ex. 'git add app/removed_file.rb'

On Friday, January 31, 2014 8:56:51 AM UTC-6, Bizt wrote:
Hi,

In rails I run "rails generator destroy..." for my controllers and models. When I "git add . " files and commit changes, git tells me I have missing files. How best to handle this? I want the files off git as I don't need them anymore, they're not in my local repository. Do I then need to manually "git rm ..." for each one. Is there is quick way to just remove these files from git? Usually destroy command deletes many files.

Cheers
Bizt

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/996ea34f-b95c-4e3e-9f06-ba622e0900a3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Well, you're many versions ahead of where I was when I hit this issue. I tried all sorts of things at the time, switched to db-backed sessions, fiddled with minor versions, and then _something_ worked. But I remember it was incredibly frustrating , because it would work for a few logins and then return to the problem again. I was deleting cookies, restarting my Mac, trying other browsers... nightmare.

Walter

On Jan 31, 2014, at 10:38 AM, Enrico Pilotto wrote:

> Im using Rails 4.0.2, devise (3.1.1), omniauth (1.1.4),
> omniauth-facebook (1.4.1), omniauth-twitter (1.0.1), cancan (1.6.10) and
> ActiveAdmin.
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3f2fca05ee4f0485b941e94cd2d2e209%40ruby-forum.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1864F2E4-EE72-46CA-8B73-DE6DE5B78BA1%40wdstudio.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Im using Rails 4.0.2, devise (3.1.1), omniauth (1.1.4),
omniauth-facebook (1.4.1), omniauth-twitter (1.0.1), cancan (1.6.10) and
ActiveAdmin.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3f2fca05ee4f0485b941e94cd2d2e209%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 31 January 2014 14:56, Bizt <martyn.biz@gmail.com> wrote:
> Hi,
>
> In rails I run "rails generator destroy..." for my controllers and models.
> When I "git add . " files and commit changes, git tells me I have missing
> files. How best to handle this? I want the files off git as I don't need
> them anymore, they're not in my local repository. Do I then need to manually
> "git rm ..." for each one. Is there is quick way to just remove these files
> from git? Usually destroy command deletes many files.

Use git gui (unless you don't have a graphic UI). Then it is easy.

Colin

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtcNoB8Ctre4Gcw4_qE55TTtALCxZQKdrgMRp1KJLwojA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Oh man, I went through this a while back, and while it got better, I'm not sure exactly what I did that made it so. I think I rolled back a minor version or two, and all was well. Jobs I have done since then worked just fine with whatever was current, so I think it may have been a wonky minor version. What versions of Ruby, Rails, and Devise are you using, and are you using any of the third-party stuff like Invitable?

Walter

On Jan 31, 2014, at 5:52 AM, Enrico Pilotto wrote:

> I have the same exactly problem using a simple login form with Devise...
> Any solution, or idea of the problem?
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3f001e6d20412181eb55630943c2e60f%40ruby-forum.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8E8DB38E-2C94-4ECD-97A0-8877DEF9D1EF%40wdstudio.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



On Friday, January 31, 2014 2:51:45 PM UTC, Bizt wrote:
Yeh I tried that. I don't seem to have any BS files in assets yet it will still applying BS styles.

Actually, I had the line in a custom.css.sass file:

@import "bootstrap";

I'll remove this line, update the Gemfile and reinstall?

Btw if I replace the line:

gem 'bootstrap-sass', '2.3.2.0'

.. with a newer version of BS, will it automatically remove this old one? I'm a little new to using gems, not too sure yet how it all works.


That should work: when rails searches for assets it looks in app/assets, lib/assets and vendor/assets in your app, but it also does the same with gems. This means that gems like ones providing jquery, bootstrap etc. don't need to copy their files into your app (and conversely, all you need to do is upgrade the gem to get the new versions)

Fred 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/87344e5c-a485-4263-b7a5-0ca937266171%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,

In rails I run "rails generator destroy..." for my controllers and models. When I "git add . " files and commit changes, git tells me I have missing files. How best to handle this? I want the files off git as I don't need them anymore, they're not in my local repository. Do I then need to manually "git rm ..." for each one. Is there is quick way to just remove these files from git? Usually destroy command deletes many files.

Cheers
Bizt

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cc4079f7-7675-4f3f-93f9-6ed39cd1c74b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 22/1/2014 5:35 PM, Adam Gilchrist wrote:
> Hi all, I looking for best company on Ruby on Rails Development in
> India. Have any good companies in India please let me know.
>

Josh Software - they are great and very good contributors too.
http://www.joshsoftware.com/


Best Regards,
Mohit.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/52EBB8B2.1070706%40onghu.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Yeh I tried that. I don't seem to have any BS files in assets yet it will still applying BS styles.

Actually, I had the line in a custom.css.sass file:

@import "bootstrap";

I'll remove this line, update the Gemfile and reinstall?

Btw if I replace the line:

gem 'bootstrap-sass', '2.3.2.0'

.. with a newer version of BS, will it automatically remove this old one? I'm a little new to using gems, not too sure yet how it all works.


On Friday, 31 January 2014 23:26:07 UTC+9, Arun kant sharma wrote:
Maybe
rake assets:clean
will help



On Fri, Jan 31, 2014 at 7:53 PM, Bizt <marty...@gmail.com> wrote:
Hi,

I added this line to my Gemfile, then done "bundle install"

gem 'bootstrap-sass', '2.3.2.0'

...but, I now want to install the latest version of bootstrap. How do I uninstall these files, do I just go into the assets directory and manually delete them? Then, add the recent version to my Gemfile?

Cheers
Martyn

--
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.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0d6b0c39-319c-4636-b8d7-dd55c938846c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/036df30e-5bd3-4aaf-9c1d-6824e4b61bfe%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Maybe
rake assets:clean
will help



On Fri, Jan 31, 2014 at 7:53 PM, Bizt <martyn.biz@gmail.com> wrote:
Hi,

I added this line to my Gemfile, then done "bundle install"

gem 'bootstrap-sass', '2.3.2.0'

...but, I now want to install the latest version of bootstrap. How do I uninstall these files, do I just go into the assets directory and manually delete them? Then, add the recent version to my Gemfile?

Cheers
Martyn

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0d6b0c39-319c-4636-b8d7-dd55c938846c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAGHQMcih8nHA4f--9x7P7j%3D21nfBAUdts5V6qC-vPVvG6%2B-CTA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,

I added this line to my Gemfile, then done "bundle install"

gem 'bootstrap-sass', '2.3.2.0'

...but, I now want to install the latest version of bootstrap. How do I uninstall these files, do I just go into the assets directory and manually delete them? Then, add the recent version to my Gemfile?

Cheers
Martyn

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0d6b0c39-319c-4636-b8d7-dd55c938846c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I am fresher to RoR but interested to work in it. I am learning RoR and created 3-4 simple application in it. 
I want to learn more and make career in it. 
           I use repository Github and deploy on Heroku site, below link is given.
linkedin profile http://in.linkedin.com/in/vyavaharekishor/

  • Please refer me in your company or your RoR friends company.

Thank you.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b5725159-76b3-49bd-be34-585982dac1df%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

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 same feature in the Rails 1 version could be taken offline. Users would see a mix of the two versions. Some pages would be served by Rails 1 and others by Rails 4.

This would require both the Rails 1 and Rails 4 versions to use the same database.

So my question is, will this work? What problems with this approach should we be anticipating? We know it isn't a perfect solution, but we're hoping it's good enough to drive the project forward.

The thing to consider most carefully is how you will be able to run the single website from two different rails apps.  Things like linking between them, sharing authentication, session variables like session and flash, stuff like that.  Databases are inherently multi-user systems so you're not so likely to run into problems with the database itself unless you are using sqlite, although I'm not so familiar with Rails 1 ActiveRecord mechanisms anymore.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0f243c68-c52f-4fb1-9905-d73486d3334a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,
I am new to integrate the social media linkedin in our ruby on rails
application.I registered the application in linkedin developer
website,but I don't know how to integrate that in our application using
authentication from scratch(without using devise). I used "gem linkedin"
and configured the api-key & secrete-key.Please any one help me to do
with step by step procedure.

Thanks in advance
Hemashree

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/709fb150c337ff9cb10693f80f7a25b8%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails


On Friday, January 31, 2014 10:15:08 AM UTC, Marie Bellec wrote:

I don't think the problem comes from contôler and raw_counter,
because when I replace : 
<%= form_tag '/counters/id', method: :get %>
by: 
<%= form_tag '/counters/ovm%3Ab%3A%7Bpausecho%7D%2Fmozilla', method: :get %>

That's because your controller is looking for params[:id], but your form tag is always setting it to 'id' (because the url is /counters/id), which presumable results in redis returning nil. (The value of your search field is in params[:counters])

It might also be prudent to check what is returned from redis before using it.

A form can't change the path submitted to based on the fields submitted, so you either have to have some dummy value (if you want it to go to the show action), or else let it go to the index action, but if the :counters parameter is present, indicating that a search is being requested, then redirect to the appropriate show page.


Fred
 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ed8d6612-fa98-470a-971e-2429bc1f2568%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I have the same exactly problem using a simple login form with Devise...
Any solution, or idea of the problem?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3f001e6d20412181eb55630943c2e60f%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I have a 2 entities which have many to many relation say teacher and subject. Each teacher has many subjects. I want to perform search on teacher by sunspot solr for all the teacher who teaches 3 subjects biology, anatomy and botany with specific time.


----------


Say model structures and relations as follows

    Teacher - name, roll, ph no
    has many :subjects
    searchable do 
      string :subjects, multiple => true, stored => true do
       subjects.map(&:title)
      end
      string :time, multiple => true, stored => true do
        subjects.map(&:time)
      end
    end

    Subject - title, time, teacher_id
    belongs_to :teacher


How would I perform solr search query for the teachers who are having all 3 subjects biology, anatomy and botany at time 3:00pm.
I am trying with following code which is not taking and condition to retrieve only the teachers teaching all the 3 subjects rather its taking as or condition.

    Sunspot.search(Teacher) do
      with(:subjects, "biology")
      with(:subjects, "anatomy")
      with(:subjects, "botany")
      with(:time, "3:00pm")
    end.results


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/50ff3bee-770e-485b-a47b-8386a8146aa0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Here is the counters_controller.rb code : 

class CountersController < ApplicationController
  #require 'colorize'

  before_action :get_counter, only: [:show, :edit, :update, :destroy]

  # GET /counters
  # GET /counters.json
  def index
  end

  # GET /counters/1
  # GET /counters/1.json
  def show

    raw_counter = REDIS.hget(params[:id], 'c')
    raw_counter_reset = REDIS.hget(params[:id], 'overquota_reset_c')
    raw_counter_reset_date = REDIS.hget(params[:id], 'overquota_reset_at')
    #@counter_max = 'put'.red
    #@counter_msg.red
    @counter = {:id => params[:id]}
    if raw_counter == '0'
      @counter_msg = '0'
      @counter_max = '0'
    else
      @counter_msg = raw_counter[9..17]
      @counter_max = raw_counter[1..6]

      #if @counter_msg > @counter_max

     

Ruby on Rails Thursday, January 30, 2014

Hello All,

I am trying to integrate god with nginx+passenger.
Rails 3.2.8, Ruby 1.9.3

I am not getting the exact process how to integrate it.
Should I create a .god file inside config in our project or outside project?
How can I link this to the servers?



Thanks,
Avi

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0f800d75-2d0a-447f-ad7b-3876c604086e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Its working fine now. We have changed from thin to nginx + passenger.

Thanks for helping.

On Wednesday, January 29, 2014 9:41:45 PM UTC+5:30, Hassan Schroeder wrote:
On Wed, Jan 29, 2014 at 6:55 AM, Avi <aavinas...@gmail.com> wrote:

> I am using "Thin server" in production.
> Ruby - 1.9.3
> Rails - 3.2.8

There's a known similar problem with Puma that I ran into -- see this
support entry: https://docs.newrelic.com/docs/ruby/puma#daemonizing

WAG: I don't use Thin but you might try setting ` --servers 1` and see
if that "fixes" it. Otherwise, open a ticket with newrelic. :-)

(Also, your Rails version has security issues; you should upgrade.)

HTH,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/725a7bfd-5c20-405a-92da-a14d790e6f04%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



The problem is solved. I forgot to add following in model:

has_attached_file :resume_attachment

In addition, I looked at this reference and saved the file in paperclip through File class

     my_model_instance = MyModel.new
     file = File.open(file_path)
     my_model_instance.attachment = file
     file.close
     my_model_instance.save!

Thanks. 

--
Regards,
Ankur 

On 31 January 2014 01:35, Ankur Kumar <specialankur@gmail.com> wrote:

I am trying to save a pdf file (generated using Rails PDFKit gem) to a paperclip attachment. The MySQL table entry shows following for the paperclip attachment after saving the generated PDF file:

MySQL table record:

*************

id | resume_type | resume_attachment_file_name | resume_attachment_content_type | resume_attachment_file_size | resume_attachment_updated_at

1   | pdf   |   !ruby/object:File {}   |   NULL   |   NULL |   NULL |

**************

as against expected value to be something like in this format:

resume.pdf | application/pdf | 38375 | 2014-01-30 18:24:34

**************

Can someone please tell me what's going wrong here?

Controller:

    html = render_to_string('resume.html.erb',layout: false)  kit = PDFKit.new(html, :page_size => 'Letter')    file_name = "resume"    path = "#{Rails.root}/app/assets/PDF/" + file_name.to_s + ".pdf"  **file** = kit.to_file(path)    document = Document.new(:resume_type=>"pdf")  document.resume_attachment_file_name = **file**  document.save! 

schema.rb

    create_table "documents", :force => true do |t|  t.string   "resume_type"  t.string   "resume_attachment_file_name"  t.string   "resume_attachment_content_type"  t.integer  "resume_attachment_file_size"  t.datetime "resume_attachment_updated_at"

Thanks.

Regards,

Ankur


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALSL1eOM69QXNqzZWX2mh3U9in_JSpTB%3DkKjAUZHa9JaAzBpCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.