Re: [Rails] Routing error

2013-07-22 Thread Tamara Temple

On Jul 21, 2013, at 6:06 AM, trekr67  wrote:

> Hi,
> 
> I'm a newbie Ruby on Rails developer and have across the following problem:
> 
> I've put an image on a page and want to be taken to twitter to be 
> authenticated, when the image is clicked however I get the following error 
> when I do:
> 
> ActionController::Routing error (No route matches [GET] "auth/twitter"
> 
> I've registered my app on the Twitter dev site and have installed Ominiauth 
> and Omniauth-Twitter gems. I've also added my Consumer keys and Consumer 
> secret keys (for Twitter) to the relevant files.
> 
> This is the code around my image:-
> 
> =link_to image_tag("twitter.png", :size => "32x32"), "auth/twitter", :id => 
> 'twitter image'
> 
> Can anyone help please as I'm pulling my hair out in frustration!

First thing you should do is run:

$ rake routes

and see if there is a route for auth/twitter.

If there is not, add one in config/routes.rb for that route.

Read http://guides.rubyonrails.org/routing.html thoroughly.

-- 
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...@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/E5C8446E-8877-4D92-A670-F2424C6E3C32%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Does anyone develop on Mac and deploy on *BSD?

2013-07-22 Thread jmcguckin
I have many questions...

Joe

-- 
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...@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/b95c1a83-c002-426f-9606-2a87fadd2983%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Using :group with #count generating bad SQL in Postgres

2013-07-22 Thread yaw
Rails 4.0.0, Ruby 2.0

class Title < ...
  ...

  has_many :comments

  def self.order_by_number_of_comments_descending
select('titles.*, count(comments.id) AS comments_count').
joins(:comments).
group('titles.id').
order('comment_count DESC')
  end

results in a malformed SQL on Postgres,


SELECT COUNT(*) AS count_all, titles.id AS titles_id FROM "titles"
INNER JOIN "comments" ON "comments"."title_id" = "titles"."id" GROUP BY 
titles.id ORDER BY comments_count DESC

I've contacted @steveklabnik and he'd re-open an issue reporting this 
bug.In the meantime, has anybody 
got around this? The SQL is all correct until 
you call group.
Thanks for helping

-- 
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...@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/5def0eff-649b-4e00-9b87-154f02b9f34d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: “Add 'gem sqlite3'' to your Gemfile”

2013-07-22 Thread Константин Медведев
On Friday, 28 June 2013 02:53:20 UTC+4, Ruby-Forum.com User wrote:

> Hi guys, 
>
> I only have Notepad to view this information, so it just looks like a 
> long line of text. 
>
> Gemfile.lock has the following text: 
> sqlite3 (1.3.7-x86-mingw32) 
>

I had the same troulbe on Windows7-x64 even I made everything according to 
https://www.ruby-forum.com/topic/4413168
Then I opened Gemfile.lock file and just edit this row to "sqlite3 
(1.3.7-x64-mingw32)" and run server again - it worked correct. Hope it will 
help somebody

-- 
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...@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/75e89fc7-92f4-4d03-a5cf-e0275d1f3928%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Routing error

2013-07-22 Thread trekr67
Hi,

I'm a newbie Ruby on Rails developer and have across the following problem:

I've put an image on a page and want to be taken to twitter to be 
authenticated, when the image is clicked however I get the following error 
when I do:

ActionController::Routing error (No route matches [GET] "auth/twitter"

I've registered my app on the Twitter dev site and have installed Ominiauth 
and Omniauth-Twitter gems. I've also added my Consumer keys and Consumer 
secret keys (for Twitter) to the relevant files.

This is the code around my image:-

=link_to image_tag("twitter.png", :size => "32x32"), "auth/twitter", :id => 
'twitter image'

Can anyone help please as I'm pulling my hair out in frustration!


-- 
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...@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/5b41e5e5-fac1-4e53-9d9d-f3e5d87bc9ae%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] how to use activemodel collection.build for a has_many :through association

2013-07-22 Thread James Gray
Hi all,

In my controller I am doing the following to populate a nested form for a 
has_many through association:

def new
   @specification = Specification.new

Component.find_each.each do |component|
  @specification.component_specifications.build(:component_id => 
component.id)
end

The idea being whenever someone creates or edits a form, it will be 
populated with all components at that time so that when they save those 
components that specification will be associated with the newly created 
specification. The problem I am having is I can't work out how to pass 
component name to display in my form for the as yet nonexistent 
component_specification as it is not accessible through the 
ComponentSpecification model.

My models:

class Specification < ActiveRecord::Base
  attr_accessible :description, :name, :component_specifications_attributes

  validates :name, :presence => true, :uniqueness => true

  has_many :component_specifications
  has_many :components, :through => :component_specifications

  accepts_nested_attributes_for :component_specifications, :allow_destroy 
=> true
end


class ComponentSpecification < ActiveRecord::Base
  attr_accessible :note, :colour, :brand, :components

  has_many :components

  belongs_to :specification
end

class Component < ActiveRecord::Base
  attr_accessible :description, :name

  belongs_to :component_specifications

  validates :name, :presence => true, :uniqueness => true
end

Thanks in advance,
James

-- 
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...@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/aab0285b-479b-4482-948b-1feb6e8771cf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Combine two apps into one? Engines?

2013-07-22 Thread andreo
1.So what is that happens on the views? 
2.When you try to visit the login path, what happens? 
3.Do you have tests for it? where does it fail in the tests? 
4.Whats the output on the logs?
5.Have you tried to use something like ruby-debugger to go through the code 
and see what happens on the views?

all the best,

Andre

-- 
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...@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/278cdf2d-7c4b-4998-9d69-145698cb5cea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] rails is not to logging controller, action, parameters, complection time, etc in development mode

2013-07-22 Thread John Merlino
For this one particular project, rails is not to logging controller, 
action, parameters, complection time, etc in development mode. And I am not 
sure why.

When I check in the console the log level I notice:

Rails.logger.level
 => 0 

So I am not sure why it doesn't log the information it usually does during 
a request. 


-- 
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...@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/ae27ecd7-90a7-44c2-a6bc-c0282e6f3518%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: How to create first user for sign in using devise

2013-07-22 Thread Robert Walker
Emil S. wrote in post #1116233:
> I use email for login , so I do this in the console/database seed file :
> User.create(email: 't...@test.com', password: 'password123',
> password_confirmation: 'password123')
> Then I log in with the "t...@test.com" and "password123"

Personally speaking, I generally dislike the practice of using email 
addresses as usernames. Yes, it has a certain convenience. Convenience 
will always be in contention with security.

There are a number of reasons for this:

1. If the site gets hacked there is no way to protect email addresses 
from exposure. If email addresses are kept separate from the user 
account information then it is at least possible to protect them from a 
hack against the user login info.

2. If a user changes their email address (or otherwise loses control of 
their email account) they have no way to verify themselves in case they 
need to reset their password.

-- 
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+unsubscr...@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/109f507533ae30c67151c56b115d7a16%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] How to create first user for sign in using devise

2013-07-22 Thread Norbert Melzer
Devise has a wonderful kickstarter, just take a look into the readme and
follow the steps.
Am 22.07.2013 13:50 schrieb "Tushar Patil" :

> Hi,
>I want to authentication for sign in and sign out, i add gem file and
> create a user model using devise in rails3, i want to create a user for
> first sign in and sign out, how  can i create, any suggestion.
>
> --
> 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...@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/1387c52c-3684-44f1-89b7-4cc93a2aadb5%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+unsubscr...@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/CA%2BbCVsvy%2BZRhBBrQRK5nvm%3DUE8gcfg6NmgHWCw%2BhF1LCKxzECg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: How to create first user for sign in using devise

2013-07-22 Thread Dave Aronson
On Mon, Jul 22, 2013 at 11:39 AM, Robert Walker  wrote:

> I generally dislike the practice of using email
> addresses as usernames.

Amen!  In addition to the reasons you list, people often have multiple
addresses at once -- I myself have several, not even including the
hundreds of special-purpose ones I make up on the fly at my domains.
Then, logging into a system you haven't been on in years, do they
really expect you to remember *which* address you used back then *for
that site*?  Meanwhile, I use the same username almost everywhere;
just about the only exceptions are a few places where that's too long,
or it has to have both letters and digits.  (Yes I mean the username,
not the password!)

-Dave

-- 
Dave Aronson, the T. Rex of Codosaurus LLC,
secret-cleared freelance software developer
taking contracts in or near NoVa or remote.
See information at http://www.Codosaur.us/.

-- 
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...@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/CAHxKQihbVvTT4%3Ds5JTH3jaokp4cSUV8rnnqk7k0MMHx2juWZwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] How to create first user for sign in using devise

2013-07-22 Thread Tushar Patil
Hi, 
   I want to authentication for sign in and sign out, i add gem file and 
create a user model using devise in rails3, i want to create a user for 
first sign in and sign out, how  can i create, any suggestion. 

-- 
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...@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/1387c52c-3684-44f1-89b7-4cc93a2aadb5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] How to create first user for sign in using devise

2013-07-22 Thread Emil S
I use email for login , so I do this in the console/database seed file :
User.create(email: 't...@test.com', password: 'password123',
password_confirmation: 'password123')
Then I log in with the "t...@test.com" and "password123"


On 22 July 2013 17:21, Dheeraj Kumar  wrote:

> Create a new User object, then fill in the fields, and call save.
>
> --
> Dheeraj Kumar
>
> On Monday 22 July 2013 at 5:19 PM, Tushar Patil wrote:
>
> Hi,
>I want to authentication for sign in and sign out, i add gem file and
> create a user model using devise in rails3, i want to create a user for
> first sign in and sign out, how  can i create, any suggestion.
>
> --
> 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...@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/1387c52c-3684-44f1-89b7-4cc93a2aadb5%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+unsubscr...@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/05B2251B87C649EAB0DE5C025F73EE8C%40gmail.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+unsubscr...@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/CAJ%3Dox-ATBkyN%2BmENdH5mii9%2B%2BoFSnF0MXy9WN2ZBvZXGYgsn%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Combine two apps into one? Engines?

2013-07-22 Thread Patrick Bartels
That's exactly what I'm trying but routes etc. are not working hence 
this post :)

-- 
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+unsubscr...@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/b75b1767f17ba1acc2fc097df39ee9ca%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Combine two apps into one? Engines?

2013-07-22 Thread andreo
 What about an approach where you publish both applications as gems? 
wouldn't that work? a setup like spree where you have spree_social and 
stuff like that?

-- 
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...@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/6c957625-c7b5-4f64-8193-1575eba13e6a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] How to create first user for sign in using devise

2013-07-22 Thread Dheeraj Kumar
Create a new User object, then fill in the fields, and call save.

-- 
Dheeraj Kumar


On Monday 22 July 2013 at 5:19 PM, Tushar Patil wrote:

> Hi, 
>I want to authentication for sign in and sign out, i add gem file and 
> create a user model using devise in rails3, i want to create a user for first 
> sign in and sign out, how  can i create, any suggestion. 
> 
> -- 
> 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...@googlegroups.com 
> (mailto:rubyonrails-talk+unsubscr...@googlegroups.com).
> To post to this group, send email to rubyonrails-talk@googlegroups.com 
> (mailto:rubyonrails-talk@googlegroups.com).
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/1387c52c-3684-44f1-89b7-4cc93a2aadb5%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+unsubscr...@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/05B2251B87C649EAB0DE5C025F73EE8C%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.