Re: [Rails] Minitest mock or stub methods

2013-06-09 Thread Tamara Temple
> On Sunday, June 9, 2013, Linus Pettersson wrote: > > > > Hi > > > > I'm building a small library to use in my Rails app which interacts > > with a 3rd party API. It fetches artists and tracks. > > > > So I have: > > lib/my_lib.rb > > lib/my_lib/artist.rb > > l

[Rails] Re: How to integrate a scanner to rails application

2013-06-09 Thread Philip J B.
You can use a java plugin just for the scanning page. -- 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 rubyonra

[Rails] Re: form_for instance model help; move logic from form to controller

2013-06-09 Thread andreo
so if in your action you do @relationship = current_user.relationships.build(followed_id: @user.id) you should have a variable called relationship on your view: <%= form_for(relationship) do |f| %> <%= f.hidden_field :followed_id %> <%= f.submit "Follow", class: "btn btn-large btn-primary"

[Rails] invalid authenticity tokens happening sporadically

2013-06-09 Thread Martin Luy
The invalid authenticity tokens are happening ~1x per day in average and with all kinds of forms in my app. Could it be that the token was outdated because the page was in the browser cache of the user? If so, how do you deal with that? might be overkill... How can we include this only for pag

[Rails] Re: Hook for "rake db:migrate" to transfer command to plugin?

2013-06-09 Thread Frederick Cheung
On Saturday, June 8, 2013 3:28:56 PM UTC+1, Ruby-Forum.com User wrote: > > I want to put all app migrations in a plugin. And then when I run > > > rake db:migrate > > and as the command is not able to find migrations in > "App\db\migrate" directory (the default one) I want it to be redirecte

[Rails] Re: Version issue with First App in Hartl Tutorial

2013-06-09 Thread mike
On Saturday, October 13, 2012 10:47:44 AM UTC-4, Tim Escher wrote: > > Stepping through the Hartl Rails 3 Tutorial from the 2nd edition book hot > off the presses. Modified the Gemfile *exactly* as specified in the book, > immediately got version issues: > > Could not find gem 'jquery-rails (=

Re: [Rails] Minitest mock or stub methods

2013-06-09 Thread thiagocifani
Hello man, I think you can easily accomplish this task declaring a variable, using file.open to read a XML from your file system, and stubbing your method call on your test. This is the most common way of doing some tests with third party apis. But, if you want a more reliable way to do some test

[Rails] Minitest mock or stub methods

2013-06-09 Thread Linus Pettersson
Hi I'm building a small library to use in my Rails app which interacts with a 3rd party API. It fetches artists and tracks. So I have: lib/my_lib.rb lib/my_lib/artist.rb lib/my_lib/track.rb To get an artist I do artist = MyLib::Artist.find("Oasis") Which returns an instance of Artist if it find

Re: [Rails] Re: Re: Re: Why Nokogiri::HTML::Document#meta_encoding returns nil ?

2013-06-09 Thread Tamara Temple
Love U Ruby wrote: > Can you give me one example for the method `parse(string_or_io, url = > nil, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML)` where > `url` is used? I don't understand the meaning of the `url` and `options` > as a parameter. So looking for an example where those

[Rails] Nokogiri::XML::AttributeDecl methods output understanding

2013-06-09 Thread Love U Ruby
Hi, Today morning my target is going through the ` Nokogiri::XML::AttributeDecl` methods. So I wrote some simple codes to understand these methods: require 'nokogiri' doc = Nokogiri::XML::Document.new # => # attdcl = Nokogiri::XML::AttributeDecl.new('bar',doc) # => #"> attdcl.enumeration # => [

[Rails] Re: Version issue with First App in Hartl Tutorial

2013-06-09 Thread Marek Rohon
it would be easier if you provide a snapshot of your gemfile. My suggestion is to install jquery- rails gem according to this link: https://github.com/indirect/jquery-rails On Saturday, October 13, 2012 4:47:44 PM UTC+2, Tim Escher wrote: > > Stepping through the Hartl Rails 3 Tutorial from th