I'm getting the error in the title when trying to select a cookie value from a table in a postgresql database, and I've no idea why. Selecting other fields in this table work fine.
Here's the line where it is breaking:
user=UniqueUser.find(:all, :select => 'DISTINCT visitor_id', :conditions=> "visitor_id=#{visitorid}")
The column is...
i have this code in my index.html:
<div id="users-list">
<tr class="<%= cycle('odd', 'even') %>" onmouseover="this.className='over';" onclick="location.href='<%= user_path(user) %>'" >
<td><%= user.surname %></td>
<td><%= user.name %></td>
</tr>
</div>
as part of a table, and this associated css:
#users-list .odd {
backg...
Hi,
I have string "(1,2,3,4,5,6),(1,2,3)" I would like to change it to "('1','2','3','4','5','6'),('1','2','3')" - replase all parts that mathces /([^,)("])/ with the '$1', '$2' etc
...
Is it possible to just log partial times without turning on all logging with?
config.log_level = :debug
I just want to see partial times as all the others seem under control and don't want to slow down the application to get this logging.
...
Hello,
I have set up my models to use a polymorphic Image model. This is working fine, however I am wondering if it is possible to change the :styles setting for each model. Found some examples using STI (Model < Image) However this is not an option for me, because I am using a has_many relation.
Art
has_many :images, :as => :imageabl...
Hello.
I'm using Rails 3 / factory_girl_rails / Rspec 2 and Ruby 1.8
I've defined my factories this way:
Factory.define :user do |u|
u.name 'Some guy'
u.sequence(:email) {|n| "person#{n}@example.com" }
u.password 'password'
end
Factory.define :password_reset_user, :parent => :user do |user|
user.password_reset_key '...
I've got a legacy table that my rails application shares with another application. It has a column called "class". The first time I reference any attribute in that model, I get an error. Subsequent references to attributes work. Is there a good workaround for this, or should I just go modify the other application that uses this table (...
Just trying to set up some basic links with authlogic.
here they are
<% if current_user %>
<div class="register_new_user">
<%= link_to "Register", new_user_path %>
</div>
<div class="login_existing_user">
<%= link_to "Log In", new_user_session_path %>
</div>
<% else %>
<div class="logout">
<%...
When I start my server locally, I get the following notice:
please set config.active_support.deprecation to :log at config/environments/development.rb
When I add in config/environments/development.rb
config.active_support.deprecation = :log
I get:
undefined local variable or method `config' for main:Object (NameError)
my envir...
Specifically, I have written a Rails app in which I'm using the default (in Rails 2.3.5) CookieStore session store and I've spotted an odd problem in development.
Myself and a few others had been using the site for a few weeks and we each had a login based on a username and password (each user registered themselves and I stored the (sal...
Hi,
I'm searching for a plugin or a simple way to make an image rotatable by dragging (with the mouse) a button on this image.
I want to be able to save the angle rotation too.
Does anyone know how to do it easily please?
thanks
...
pulled down a repo from git. For some reason I need to do
./script/rails.rb s
where on the rails 3 ap I started on my box, I can just do the
rails server
can anyone help me set up my environment so I don't have to do this? I'm still trying to figure out what I need to type to do a migration...
...
I'm setting up security on my Rails App according to the Ruby on Rails Guide.
My understanding is that the 'edit' method in the Users Controller (which I'm using to render my User settings view) should only be submitting a GET request, and that the 'update' method is submitting the POST request. But when I want to verify the types of r...
Hello,
In my Rails application, I would like to use simultaneously 2 backends, the first one storing translations in a DB, and the second one being the default YML based backend. I woud like that this second backend serves as a fallback backend, ie if a translation is not found in the first, Rails looks up the translation in the second ...
I have a Rails 3 project that does file upload/download, with access rights (User has many Files, and can only read/write his own files).
If I store my files on classic filesystem, I can check the access to the file in my rails app and then use X-Sendfile header to redirect to the file, if user has access. In this way, a user can neve...
I sort of want to do the reverse of this.
Instead of unzipping and adding the collection files to S3 I want to
On user's request:
generate a bunch of xml files
zip the xml files with some images (pre-existing images hosted on s3)
download zip
Does anybody know agood way of doing this? I think I could manage this no problem on a ...
Is there a ruby method to POST form data encoded in "x-www-form-urlencoded" as specified here? http://www.w3.org/MarkUp/html-spec/html-spec_8.html
I am aware of Net::HTTP.post_form, but because I have several values to post which share the same name I can't use a hash, which is required by that method.
To clarify, I have a string of th...
Is it possible to override a RESTful path?
For instance, I have photo_path(photo) which would generate /photos/12345
But I'd like for all uses of photo_path to actually generate URL's like /photos/joeschmoe/12345 (which is the photo's user and the photo id).
Obviously I could just create a new route, but wanted to make sure there wasn...
In script/console
Storage.find(:all , :conditions => "item_id=1" , order => "expire_date DESC")
i get
NameError: undefined local variable or method `order' for #<Object:0xb7761954>
from (irb):5
But it works when i use
Storage.find(:all , :conditions => "item_id=1")
...
Calendar in our app is displayed using Fullcalendar plugin by arshaw
Here it is: http://avatara.su/calendar
There is a need to export this page to pdf. I always used PDFkit gem to do this, but with fullcalendar it doesn't work. It just renders an empty calendar grid, without rendered events.
I tried to set 10 seconds for wkhtmltopdf t...