In Solr/Lucene is it possible to order first by relevance, and then by a second attribute?
As far as I can tell if I set an ordering parameter, it totally overrides relevance, and sorts by the ordering parameter(s).
How can I have results sorted first by relevance, and then in the case of two entries with exactly the same relevance, gi...
Hello!
I'm looking to migrate users of a rails app which uses the Restful Authentication module (which uses a stretched sha1 encryption algorithm) to a Django app, using the default authentication framework (which uses a plain sha1 algorithm). Does anybody know how I can make this happen? specifically, can I somehow implement the same e...
I am making a concerted effort to wrap my head around Rspec in order to move towards more of a TDD/BDD development pattern. However, I'm a long way off and struggling with some of the fundamentals:
Like, when exactly should I be using mocks/stubs and when shouldn't I?
Take for example this scenario: I have a Site model that has_many :b...
Hi,
I get this error in Rails 2.3.9 but not in 2.3.8. I didn't changed any code. Did I missed anything?
ActionController::InvalidAuthenticityToken in SessionsController#create ActionController::InvalidAuthenticityToken
Thanks :)
Here are the added details.
Request
Parameters:
{"commit"=>"Login",
"authenticity_token"=>"A9A4+sCsA/...
I have set up an asset host at assets.domain.com but it appears that cookies are being sent with requests to assets.domain.com. I read somewhere that if you have cookies set to domain.com then this will happen.
So I guess I'm trying to set cookies only to www.domain.com so that requests to assets.domain.com will not send cookies. (I als...
I am using the perishable token magic in authlogic to do password resets. However, it seems that the token is getting reset when a user tries to log in and fails. This is because authlogic is incrementing failed login attempts on the user record. So if the user requests a new password and then tries to log in before resetting the pass...
Looking for a good tool/gem that can automatically generate a nice looking UML diagram for an existing rails application.
(Im imagining such a tool would read the schema.rb file and then scan the models for relationships)
...
def role?(role)
return !!self.roles.find_by_name(role.to_s.camelize)
end
Can you help me understand what's happening in the code above? I'm new to Rails/Ruby.
Thanks
...
We do not get much projects in Ruby, we are so far focused only on PHP. As a web development agency are we missing an important channel of revenue due to our unopened nature with Ruby and Ruby on Rails?
If we start doing some local projects, learn Ruby, is is possible to open another revenue channel? Is it wise to ask PHP developers to l...
I have a simple function within my model to set a completed datetime column in a database. this function worked until I tried to change the default rails format for datetime.
After reading up on the issues with mysql datetime format and rails I decided to take out the formating code I had in the environment.rb
It still does not save t...
Hi All,
I have my database password starting with a '*'. When i put this on my production server i get following error:
- syntax error on line 17, col 25: ` password: *---------'.Exception class:ArgumentError.
Thanks,
Anubhaw
...
i've spent the last three days trying to get a jruby/rails/couchdb app deployed to a linux/tomcat environment. i'm ready to shoot something. my current issue is this - there is a specific gem, "simply_stored", that acts at the top level driver for couchdb. whenever i hit code in the app that touches this gem, i get this ruby trace:
IOEr...
Is there a way in Rails (using will_paginate or any other kind of pagination) to paginate by a method?
For example, I have a Movie table, associated with user ratings. I want to be able to paginate the movies based on the mean or standard deviation of the ratings (which are defined in methods in the Movie class, not as part of the datab...
Hi,
Am using action mailer in ruby on rails.
I just want to filter the recipient emails according to email_bounce flag in users table.
Is it possible to use any filter in mailer
...
I am trying building a simple project from scratch using Rails 3. Usually, the models are like:
class Student < ActiveRecord::Base
has_many :awards
end
class Award < ActiveRecord::Base
belongs_to :student
end
and we use the award.id and student.id to get the corresponding records.
But what if it is
class Company < ActiveRecord...
I'm using nginx with phusion passenger to run a rails app on an ec2 CentOS machine.
I have a pretty standard set up with nginx, rails, phusion passenger and ssl (I think). My nginx.conf is below. So far it has worked out fine except that every time 2 requests hit the server at the same time, a new rails instance is created to serve the ...
Hi,
to clarify: there's only one rails command, which gets installed from the latest Rails gem, which is Rails 3 ATM. However, I'm required to create a Rails 2.3 app.
Running ruby /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/bin/rails fails with a NoMethodError, I suppose because it also tries to use gems from the 3.0.0 release.
Unin...
I'm trying to pass an object (the current user) to be used when rendering the json for a collection.
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @items }
format.json { render :json => @items.to_a.as_json(:user => current_user) }
end
However, this seems to have no effect as options[:user] is ...
Coming from rails 2, most of my controllers would have these lines:
verify :method => :post, :only => :create, :render => {:text => '405 HTTP POST required', :status => 405}, :add_headers => {'Allow' => 'POST'}
verify :method => :put, :only => :update, :render => {:text => '405 HTTP PUT required', :status => 405}, :add_headers => {'Allo...
Hi,
I'm looking the best way to log some of save method call. It will be save in another database. I need to log model and its attributes, and user model, which should be somehow taken from session. How to make it Rails Way?
...