Displaying 20 results from an estimated 600 matches similar to: "url_helpers in /lib"
2012 May 01
0
Engine: access to url_helpers otside view/controller
I use Engine.
How to get access to url_helpers, such as <name>_path or _<name>_url, in
a separate class? In application it simple:
Rails.application.routes.url_helpers.<name>_path
But how to get access to url_helpers in Engine? When I use
Rails.application.routes.url_helpers.root_path, then I get ''/'', root of
Application. Other helpers for Engine
2008 Jun 09
10
Testing file attachment with Paperclip
Does someone have an example on faking a file upload for just ensuring
it gets called, without actually uploading the file to s3.
I thought that stubbing Model.has_attached_file would be enough, but
it doesn''t seem so ...
This is what I did:
Video.stub!( :has_attached_file ).with( :name ).and_return( true )
has_attached_file is from paperclip, it gets mixed to the model.
1)
2006 Jun 13
1
Routes question
Hi *,
I have something like
map.connect ''people/:username'', :controller => ''account'', :action =>
''index''
in my routes.rb and obviously if the user isn''t logged it defaults to
the login screen.
I''d like to be able to fetch the :username and display it in the
opposite input field inside my login page, but I
2006 Aug 17
4
Unit Tests and lib/
Hi *, I have a few modules in lib/ and I use them mostly in my models.
I''d like to add a few unit tests and run them with rake with all
other tests of my app: where do I have to write them ?
TIA,
ngw
--
Nicholas Wieland
nicholas_wieland@yahoo.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jul 21
3
ActionMailer doesn''t send any mail
I''ve configured actionmailer following the documentation, adding to
environment.rb everything for using my mail account on yahoo using
deliver_* methods to send a mail.
I can see the mail in development.log and everything seems fine, but
no mails so far.
Is there a place where can I see what the server answered, or
something to look at to solve the problem ? I have no clue,
2007 Jan 06
3
speeding up pagination
I need help to optimize a query (sort of ...)
if params[:debit] == "on"
@schools = School.find(:all,
:conditions => ["name like ?", "%#{params[:search]}%"],
:order => ''name'')
@schools.delete_if { |s| s.debit <= 0 }
@school_pages = Paginator.new self, @schools.length, 20
The problem here is that
2007 Aug 22
1
Interface for administration
Hi *, I need to choose a platform for building the administrative
part of http://www.zooppa.com
Actually I like both streamlined and activescaffold, they seem both
good.
I''d like to ask to people using it which one is more likely to manage
correctly things like validations, polymorphic associations, STI and
in general complex data.
If it''s also easy to modify it would
2007 Feb 24
1
Bug in TMail ?
I''m sending mails to a rails app, and I''m having a weird issue
fetching the email.from header.
I will paste the whole email and show what email.from returns.
#######
Received mail:
Return-Path: <nicholas.wieland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Delivered-To: unknown
Received: from mail.tochunky.org (75.126.89.28) by
adreadedsunnyday.local
with POP3; 24 Feb
2006 Apr 13
1
Model is not a class
I''m trying to specify a model in a controller, but rails gives me
"Account is not a class", where Account is my model name ...
This is my model:
class Account < ActiveRecord::Base
validates_presence_of :email, :email_confirmation,
:username, :password, :password_confirmation
validates_format_of :email,
:with =>
2013 Mar 27
0
Rspec + include Rails.application.routes.url_helpers
Hello there,
I''m having some issues trying to test a custom helper. And I been trying
to figure this out without luck. Please, see attachs for more
information. Thanks in advance.
Attachments:
http://www.ruby-forum.com/attachment/8268/errors.txt
http://www.ruby-forum.com/attachment/8269/spec_helper.rb
http://www.ruby-forum.com/attachment/8270/products_helper.rb
2013 Jun 30
1
Sidekiq on Heroku
Hi
I want to use Sidekiq to run some jobs in the background. The jobs will be
created by the whenever gem (or similar) which creates a Sidekiq worker at
a specific time. This worker will in turn create a few hundred Sidekiq jobs.
So, I''m using Heroku and wonder if I need to use a separate worker dyno for
these jobs? Or can I use, for example, Unicorn to run Sidekiq "inside"
2017 Oct 13
2
sidekiq receives SIGHUP when started via ssh -t
Hi,
I have a couple of ideas how to fix it, but I'm trying to figure out
what's going on first. I mainly start this program (sidekiq) on Debian
systems, and it might be my first time running it under CentOS, so my
conjecture is that it has to do with differences between
distributions...
Now then, when I run it this way:
ssh user at example.com '. ~/.bash_profile && rvm 2.3.1
2006 Jul 31
5
ActionWebService API
Hi *,
I need to pass a hash to a webservice, so I defined my API with:
api_method :search,
:expects => [{
:tags => :string,
:assignment => :string,
:resource => :string,
:lesson_plan => :string,
:subject => :string,
:all_types => :string
}], :returns => [[Resource]]
when I try to test the webservice with scaffold the
2013 Jun 03
1
sidekiq: push background results to front
Rails 3.2.11
Sidekiq latest
My app continues background jobs that generate texts as the output.
class ProcessText
include Sidekiq::Worker
def perform(name, count)
puts "executing..."
@feed = Feed.first
@feed.process # here it returns String results!
end
end
What I want is basically how to send (or push?) the result texts to a
particular web
2006 Jul 26
1
how do I change color to an highlight effect ?
This is my code:
<%= form_remote_tag :url => { :action => "forgot_account" }, :update
=> "result",
:complete => visual_effect(:highlight, "result", :duration =>
2, :startcolor => "#c8e673", :endcolor => "#9db55d") %>
If I remove colors to the effect everything works, but with this code
it renders on another
2006 Aug 15
1
Interval datatype in migrations
How can I use an interval datatype inside migrations ? execute ?
TIA,
ngw
--
Nicholas Wieland
nicholas_wieland@yahoo.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060815/1c262694/attachment.html
2007 Jul 08
0
UJS and make_observed
<p class="lastwinner">
<%= text_field_tag :user_search, params[ :user_search ] %>
</p>
<%= apply_behaviour "#user_search",
make_observed( :field,
:update => ''contresults'',
:with => "''user_search='' +
2006 Mar 08
3
ActiveRecord and Images
Not really a Rails question, but a "best practices" one.
If I want to associate an image to every account in my application,
is it better to insert the image file directly inside the db or to
upload the image in public/images/ ?
Also, if I want to associate a cover to a movie, what''s the best
approach ?
TIA,
ngw
--
Nicholas Wieland
nicholas_wieland@yahoo.it
2006 Nov 04
0
Using <=> in models
Hi *,
I''m going mad because I''m not able to implement a custom sort on an
array of models.
The order must be by type, where type are custom strings, so Subject
> LessonPlan > Assignment > Resource and if the type is the same by
date using a datetime field (created_at).
def <=>(other)
if self["type"] == "Subject"
return +1
2006 Jun 11
0
Account location plugin
Hi *,
I''d like to know from users of the Account location plugin if it
works with webrick without adding all the subdomains to /etc/hosts.
I''m on OS X.
I would also be glad to hear experiences using this plugin.
ngw
--
Nicholas Wieland
nicholas_wieland@yahoo.it
Chiacchiera con i tuoi amici in tempo reale!