Hello,
I'm trying to use Amazon's SimpleDB with RoR. I need a standard user registration / authentication / roles checking.
Pretty simple, but it seems that restful-authentication plugin did't work with SimpleDB.
Can someone please point me to working solution or should I write my own from scratch?
Anyone? Please?
...
Hello,
Does anyone know if it is possible to create a secure authentication system using AJAX?
I would use the same recommended security techniques, except that the user name and password would be posted using AJAX.
If anyone has any ideas on why this would not be secure, or if they could point me to any resources that discuss this I ...
I am using rails 2.3.4 . In the datetime_select helper if I select Feb 31 then I do not get any validation error. That is just wrong.
What is the best way to intercept the parameters and to present to user that there is validation error.
...
At some point in the past week, my production logs began showing bizarre numbers that don't ad up, like:
Completed in 52ms (View: 26, DB: 1129)
This query did take over one second. But, there was no database activity - no sql queries shown in mysql log nor rails log.
So, somehow the Rails app is spending a tremendous amount of time d...
I have some code that simply accesses a datetime field so activerecord converts it to a Time object automatically when I read it:
@some_appointment.some_time
The problem is that sometimes the "some_time" datetime column has bad data. "0209-12-20" instead of "2009-12-20". This causes to Ruby to throw a "year too big to marshal" error...
I've been looking at the new options available in HTML5 forms, such as declaring input types as "email", "url", and "number", as described here.
How can I use these in conjunction with the rails form builders? I have tried
<% form_for @user do |f| %>
<%= f.email :email, {:placeholder => '[email protected]'} %>
<% end %>
But that does...
Hey guys, I am making a personal website with a blog. I'd like to have certain entries password protected like I've seen on at least one wordpress. That's no biggie. But I was wondering if there was something really flexible which will allow hidden text to be revealed after a post? For example, the public post may say, "I met my friend B...
What are some good methods for handling CSS in large Rails projects? Ideally I'd like to be able to include CSS or a link to a CSS file per partial.
I've played around with using content_for and yields which allows me to insert CSS into the head of the page with partials that are located elsewhere, however some partials get used more th...
I'm just curious if Passenger does or can utilize clusters like Mongrel can. If so, how can I specifically run Passenger with clusters? I'm using nginx. And if not, how does it outperform Mongrel so well?
...
Symbols are usually represented as such
:book_author_title
but if I have a string:
"Book Author Title"
is there a built in way in rails/ruby to convert it into a symbol where I can use the : notation without just doing a raw string regex replace?
...
I'd like to have a common superclass for two models in ruby, to share several methods. Let's say I want a Truck and Car inheriting from Vehicle. Here are some options:
Make class Vehicle < ActiveRecord::Base, and have class Truck < Vehicle etc. But then I get errors saying I don't have a table for Vehicle (and I don't want one, either)...
I want to remove a list of dom events attribute from html? how to do this? like:
before = "<div onclick="abc" >abc</div>"
after = clean_it(before) // after => "<div>abc</div>"
DOM_EVENT_TO_BE_REMOVE = "onclick|ondblclick|onerror|onfocus|onkeydown" // i want to remove these events
// i want to do it like this
def clean_it(html...
Is this any possible?
I'd like to have something like
User.avatar.to_url
which would then print the full URL address for the user's avatar image.
=> "http://url.com/images/avatars/1262694724.jpeg"
Of course, the avatar attribute would be an existing column on the users table which contains a long integer.
The to_url method im th...
I have a table called "order" which has many "order_items" , each "order_items" is belongs_to "order" and "product". In the db, I have one record in order. the record is like this:
orders table: id = 1 name= customer
and the order_items table is like this:
id=1 product_id=233 order_id =1
id=2 product_id=454 order_id =1
I have the ...
Im making a calendar to display some entries and it needs to select the month and year, i use this in the controller to achive that:
def index
@month=params[:month].to_i || Time.now.month
@year=params[:year].to_i || Time.now.year
@months=[nil, "January", "February", "March", "April", "May", "June", "July", "August", "Sept...
I am working on a Rails application where customer refunds are handed to a Sweatshop worker. If a refund fails (because we cannot reach the payment processor at that time) I want to requeue the job.
class RefundWorker < Sweatshop::Worker
def process_refund(job)
if refund
Transaction.find(job[:transaction]).update_attributes(:sta...
I understand what is passed to the form_for method when doing something like :
<% form_for(@user) do |f| %> ... <% end %>
if @user is set in the controller. This is pretty obvious.
But what happens when we pass :user, as I have seen in many examples ?
<% form_for(:user) do |f| %> ... <% end %>
When should I use the symbol version ...
Does anyone know of rails hosting companies that will offer a free plan for non-profits to get up and running. I am sure it would only be free to a certain point (bandwidth, disk, etc.) but would like to explore the options.
...
We are calling a PHP web service from a Rails app using RPC. This was working fine. We had some offshore PHP programmers modify the web service and now this portion of the app throws an error that says illegal refid function.require-once.
Having never used RPC before, I am just a tiny bit confused. This would be an error with the PHP...
I have this to generate a hyperlink for me:
<%= link_to "Example", "http://example.com" %>
And I want it display in the td tag, so I want to use this content_tag to help me:
<%= content_tag(:td,"", :class => "example")%>
I want the hyperlink in my td, so I have something like this:
<%= content_tag(:td,<%= link_to "Example", "http:...