Farukh D.M | 23 May 2013 11:50
Picon

rake assets:precompile issue with JS and stylesheets files with similar name

Hi, 


I've got following two files with same names under javascripts and stylesheets directories as:
- app/assets/javascripts/test_vendor.js
- app/assets/stylesheets/test_vendor.scss

Essentially a JS and an stylesheet files with same name.

--------------------------------------------------------------

I want these files to be precompiled and served from public directory.
Thus I updated:
config.assets.precompile += %w(test_vendor.js test_vendor.scss)

----------------------------------------------------------------

I am running following task to pre-compile my assets in development:
"rake assets:precompile RAILS_ENV=development RAILS_GROUPS=assets --trace"

It generates assets/ folder inside my public directoy.
But I see only test_vendor.js and test_vendor.js.gz inside it
test_vendor.css is missing.

Please let me know, how to avoid/fix this issue.

Regards
Farukh D M





--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/074430d3-5c1f-4f1a-8180-af14539d8ff2%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Ajit Teli | 23 May 2013 11:24

Skip index in array.each_with_index loop

Can anyone help me on how to skip index in ARRAY.each_with_index loop?

Please look at below case:

In a ARRAY.each_with_index loop, I would like increase the index by 10
whenever a condition is met.

arr is array of numbers from 0 to 50
arr.each_with_index do |x,i|
  if i % 10 == 0
    puts "#{x} at #{i}"
    i = i+10  //index increased by 10
  end
end

The output should be:
10 at 10
30 at 30
50 at 50

Thanks
Ajit

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

cooker.kang | 23 May 2013 02:25
Picon

problem of respond_with working on nested resources

hi all:

    when using namespace or nested resources in routes.rb,such as "namespace :admin { resources :books }, we can use [:admin, <at> book] way to generate path. It works fine in form_for , but when I use it with respond_with in controller, I get problems. 
    The problem is when I put following code in controller:
      
        def create
          <at> book=Book.find(params[:id])
          <at> book.save
        respond_with[:admin, <at> book]
       end 

    if there are some problems and the <at> book is not saved, the function should render new action, hence we can get error messages, but now it render index action. and the log file said it got a error 302. if I replace 'respond_with [ :admin, <at> book]' with 'respond_with <at> book,:location=>admin_book_path( <at> book)", it works fine. 
    should we not use "[:admin, <at> book]" way with respond_with?

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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/13b6ac50-6e21-49bf-8bde-2f38868b7da1%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
cooker.kang | 23 May 2013 02:25
Picon

problem of respond_with working on nested resources

hi all:

    when using namespace or nested resources in routes.rb,such as "namespace :admin { resources :books }, we can use [:admin, <at> book] way to generate path. It works fine in form_for , but when I use it with respond_with in controller, I get problems. 
    The problem is when I put following code in controller:
      
        def create
          <at> book=Book.find(params[:id])
          <at> book.save
        respond_with[:admin, <at> book]
       end 

    if there are some problems and the <at> book is not saved, the function should render new action, hence we can get error messages, but now it render index action. and the log file said it got a error 302. if I replace 'respond_with [ :admin, <at> book]' with 'respond_with <at> book,:location=>admin_book_path( <at> book)", it works fine. 
    should we not use "[:admin, <at> book]" way with respond_with?

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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2348d2e4-9572-49d4-9a3a-7d91101f1e0d%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Wins Lin | 22 May 2013 21:15

Is command line Rails also so slow on Linuxes as it is on Windows?

There is a lot of questions on Stackoverflow about how Rails is slow in
command line on Windows machines. I use Windows and know that it is
true. All Rake tasks, all rails commands are very slow. Especially
testing is slow. I can't test my code as I want because of it.

But some people in their answers say that command line Rails is slow
only on Windows. On Linuxes it is ok. But before I switch to some Linux
(Ubuntu maybe) I'd like to ask if it is true that Rails on Linux is
fast.

If you have an experience of using Rails on both platforms (Windows and
Ubuntu, or some other Linux) please tell me, is it really faster/much
faster or the same/almost the same?

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

Clem Rock | 22 May 2013 16:53

Creating nested hash from nested active record results

Hello,
  I'm trying to find a very abstract and "one size fits all" for
converting nested active record results to nested hashes.   It's easy,
to do one level deep as such:

[code]
results_to_hash = Hash[ found_categories.map{ |c| [c.id, c.title]}]
[/code]

But, when I try to add another collection to the mix, it completely
borks and the results_to_hash only returns an empty hash IE:

[code]
results_to_hash = Hash[ found_categories.map{ |c| [c.id, c.title,
c.categories]}]
[/code]

Ultimately, I'd like it to be smart enough to detect if a model object
contains a collection (IE: object.class.reflect_on_all_associations),
and automatically convert those to hashes.

Any ideas?

Thanks,
Eric

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

Brijesh Bharadwaj | 21 May 2013 16:12
Picon
Gravatar

Great resource for new Rails developers

Hello everyone,


Codelearn.org has started this great initiative to document the progress of new rails developers so that it may be of use to other new developers in the future.

Do check it out and share it with people who might find it useful.


Thanks,
Brijesh

--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6f808cf6-a6ec-405e-a0cc-f4cdeb32034e%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Carol Taylor | 22 May 2013 03:48
Picon

(JOBS) 4-5 Remote U.S. based contractors needed for 2-3 month Ruby on Rails Project



My client is a flourishing, privately owned consultancy that has the energetic vibe and smart people reminiscent of the dot-coms you may have started your career at - Razorfish, Scient, iXL, Viant, Molecular, etc.
As such, you might see some familiar faces from these companies when you visit our offices! Business is great - we've been around for 5+ years, the company is profitable and revenue has grown 75% over
the past three years! We plan to add 35 people to our team this year alone.

Culture-wise, this place: culture has a start up energy to it without the craziness or uncertainty, as they have a solid infrastructure, process/methodologies/best practices, and are on firm financial footing.
The space is open to foster a friendly, collaborative environment and the decor is complemented by white boards, lots of white boards! They hire smart people who are passionate about their work.

We need 4-5 contract Ruby on Rails/Groovy developers to help us with a 2-3 month project. You can work on site or remotely.

Start: early June
End: 2-3 months; 40 hrs/week, EST preferred
Remote or on site (cambridge, MA) OK

Must have's:
    Expert knowledge of Ruby on Rails
    Experience writing native, cross-browser JS as well as using JS libraries
    SQL, Migrations
    Javascript
    AJAX

Candidates must be legally eligible to work in the U.S. & reside in the U.S.
No offshore talent, please.

Interested parties, please submit resume & target hourly rate to: CarolTaylorRecruits(at)gmail(dot)com

Twitter: TweetzTaylor
Check out my jobs at CarolTaylorRecruits.Blogspot.com
LinkedIn: http://www.linkedin.com/in/caroltaylorrecruits

--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5740bbf2-b2b8-4ca2-9e2b-bda417c72625%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
tsingle | 22 May 2013 11:28
Favicon

better rails source code documentation?

I'm new to both ruby and rails, coming from lots of experience with other languages and frameworks, and I'm struck by how poor the rails source code documentation is. For example, I'm looking at activerecord-3.2.13/lib/active_record/connection_adapters/abstract/quoting.rb, which contains


      # Quotes the column value to help prevent
      # {SQL injection attacks}[http://en.wikipedia.org/wiki/SQL_injection].
      def quote(value, column = nil)

I understand that it's debatable whether or not an end-user should directly use this, but my googling finds that many end users do in fact use it ...

How should I go about finding the answer to questions like "What is the 'column' argument? When might I want to use it?". I.e., I hoped the comments near the method definition would help ... is there a Ruby Way to answer these kinds of questions?

Assuming my complaint about the lack of documentation is legitimate, what's being done to correct it? How can I help?

--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/19e7e1a0-0715-45e1-a9bc-539e971cec2f%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Mati M. | 21 May 2013 21:08

How to develop an authentication/authorization plugin that I can use for multiple projects

I am a newbie for RoR but I liked it so far. For the current project I
already developed an authenticaion page where the user will be
authenticated before and after login. I know that I will be doing more
projects on RoR in the coming weeks as well and I don't want to copy
paste my codes to enable authentication in my projects. How can I create
an authentication system where I can use it in multiple projects. Are
there any plugins already been developed?

 You should also consider that, the authentication system also be on
call (it should be listening everytime the user goes from one page to
another page by checking if s/he is authorized and also the session
haven't expired yet and so on.). That means I still need the
authentication/authorization system to be there even after login. And
how do I integrate it with other ruby projects I will be working on.  I
hope it makes sense.

The database where users will be authorized might be the same or
different based on the projects.

Thank you

-- 
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@...
To post to this group, send email to rubyonrails-talk@...
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/73b37faf9d7ea307dd8b289afd14fa81%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

Perlyn Per | 21 May 2013 20:32

Senior Rails Developer (Job opportunity based in Singapore

Hi Rubyist,

I am a recruiter who specializes in Web and mobile technology in
Singapore.

I was wondering if you will be keen to work and live in Singapore. We
call it the little red dot because it is a small cosmopolitan country.

Please find the link below to find out more about working and living in
Singapore.
http://www.contactsingapore.sg/professionals/why_singapore/about_singapore/working_in_singapore/

This is for an established startup company who has similar business
model to airbnb.com and they target mainly Asian countries. They have
been very successful and currently looking to expand the team.

If it kicks your interest, please feel free to contact me at
pper@...

I look forward to hearing from you.
Cheers,
Perlyn

-- 
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@...
To post to this group, send email to rubyonrails-talk@...
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/98d3a5f1f04102058d4a94f752b02eec%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Gmane