I'm using Rails with resque.
The "sleep time" is the seconds of a worker sleeping after it can't find any new tasks.
The worker is created by QUEUE=* rake environment resque:work, and the default value is 5s, I can't to change it to 2s.
I have searched for this problem for several hours, somebody can help me?
...
I'm using Rails with Resque.
I know the command of redis-cli is:
expire key 100
But I don't know how to set the expire time when adding a task to resque, what should I do?
...
I'm trying to get hudson setup on a Debian server to build a rails project, and its constantly falling over at the first hurdle.
I get the following sequence of messages everytime I try to run a build:
Started by user anonymous
Checkout:workspace / /var/lib/hudson/jobs/myproject/workspace - hudson.remoting.LocalChannel@2d61100c
Using s...
The previous question is here :
http://stackoverflow.com/questions/3229758/what-is-the-common-practice-on-limit-the-result-in-ror
Here's the users_controller:
def show
@user = User.find(params[:id])
@posts = @user.posts.paginate :page => params[:page]
respond_to do |format|
format.html # show.html.erb
format.xml { re...
Hello,
I have a pre-written Rails app for handling subscription based payments that is currently covered with an Rspec test suite. I'm trying to merge it into a Rails app that is covered using the Shoulda test suite.
I'd really hate to have to rewrite all the tests into Shoulda compatible matchers manually, so I was wondering if there m...
Hi dear stackers,
I'd like to debug my app step-by-step to see what happens AFTER the form submission (only via POST).
The problem is the URL after submission is the same than the one before, and I do not know any way to tell the debugger to wait for the submission of the form...
Any ideas ?
Thanks in advance !
...
I have in outer form_tag so that I can have bulk actions.
but then I have an inner form_for for searchlogic.
only the outer form works.
The inner one doesn't show up in the HTML in inspector. (chrome)
Relavent code:
<% form_tag :controller => :objects, :action => :bulk_action do %>
<% form_for @search, :html=>{:id=>"filter"} ...
Inside the Rails code, people tend to use the Enumerable#inject method to create hashes, like this:
somme_enum.inject({}) do |hash, element|
hash[element.foo] = element.bar
hash
end
While this appears to have become a common idiom, does anyone see an advantage over the "naive" version, which would go like:
hash = {}
some_enum.ea...
I have this example:
# GET New
context "on get to new" do
it "should assign cardset" do
@profile.cardsets.expects(:build).once.returns(Factory.stub(:cardset))
get :new
assigns[:cardset].should_not be_nil
end
end
To test this method:
# GET /cardsets/new
def new
@cardset = current_user.cardsets.build
end
I am trying...
I am implementing a dynamic application for 4 desktops in my house so i don't think that security is big issue however i would like to know what is the most efficient wayto implement sessions?cookies ?store it in the database or in the memory?
thank you
...
hello!!!!!!
i m doing a project on "student attendance management system".i using rail of version 1.9.1
and rail of version 2.5. i wanted to use radiobutton in my project to mark present and absent so how can i use?please send me the code and what should i do? if you want to give any suggetion so i will very happy.
...
When fetching content from a database using activerecord, I would like to fetch a custom resultset with specified columns across two tables.
SELECT users.name, users.username, users.age, users.city_id, cities.name as city_name FROM users INNER JOIN cities ON users.city_id = cities.id
Which would be in AR as
Users.find(:all,
:join...
What is the best practice for excluding certain fields/data in a RESTful response if the user requesting it shouldn't be able to see all of the data?
Example:
Person has a First Name, Last Name, and Date of Birth.
Both authenticated and non-authenticated users can make RESTful requests to /people.xml to get a full list of people. Howe...
Is the following a good form of detecting AJAX request and setting expiration for 15 minutes so that the same GET will not require any network traffic?
# in controller
if request.xhr?
response.headers['Expires'] = (Time.now + 15.minutes).httpdate
response.headers['Cache-Control'] = '' # override any no-cache, must-revalidate
end
...
I am using the Rails helper datetime_select in one of my forms. I currently have a requirement to change the dropdowns for day, year, hour, and minute to be textboxes with validation. Is there a way I can specify that I want textboxes for these fields? Or possibly a different helper that will do what I need?
here is my usage:
datet...
Hello
I'm looking to implement pagination based on a date.
I am using a named_scope to pull a note for today but I'd like to add functionality to be able to have a previous link that will show a note for yesterday.
If I happened to be on the page for yesterday I'd also like to be able to have a link that will show the day before yeste...
Newb question of the day:
I'm trying to select all the users with this condition, and then perform an action with each one :
User.find(:all).select { |u| u.organizations.count > 0} do |user|
Except, this isn't the right way to do this. Not entirely sure what the proper syntax is.
Any fellow rubyist offer a newb a hand?
...
I'm trying to figure out how to run Juggernaut server in production – assuming that I would be able to configure different ports for the server in the development and production environment, because I can't control the port in my production environment. And also assuming that the server would be to start in "detached" mode?
Any advice m...
Hi...I am getting undefined method [] for true:TrueClass error while running the rake task in acts_as_recommendable plugin. The error points to the following line.
items = options[:on_class].find(:all).collect(&:id)
Can someone please tell what am i doing incorrectly.
...
I'm using netbeans as my IDE, and it runs into a world of hurt when I created a controller/views called Tags, presumably because it collides with some holy SVN namespace. Renaming the view folder, say, tag_views, fixes everything, but I would have to explicitly write out my render command in each action in the controller. Is there any wa...