Hi, I want to use email for signing in, and to allow users to have similar names. One way to do this is to rename login/username field to something different. However, I would prefer to do it just by authlogic settings. I tried the following
acts_as_authentic do |c|
c.login_field :email
c.validate_login_field false
c.valida...
Anybody have any good resources that might be helpful in trying to integrate the FourSquare API into a Rails app? I'm specifically looking for a good tutorial. There doesn't seem to be much out there yet. There are a few ruby gems, but they are pretty bare bones and I need a bit more hand-holding.
Here is a resource that I've found s...
I'm using will_paginate as standard, but it only shows the pagination controls (< 1 2 > etc) when there's more than one page to display. Normally, this would be what is wanted, but I want to see the pagination controls (for UI consistency and to get round an annoying CSS quirk in the system I'm working on) even when there's only 1 page t...
I would like to be able to iterate over and inspect all the models in my rails app. In pseudo-code it would look something like:
rails_env.models.each do |model|
associations = model.reflect_on_all_associations(:has_many)
... do some stuff
end
My question is how do I inspect my rails app to get a collection of the models (ra...
Hello,
I am using this http://github.com/professionalnerd/simple-private-messages plugin in rails and I am on a user page show.html.erb - User and I want to put a button there that, when clicked, goes to the current user's inbox and populates the field call "send to" with the "user" name.
How do I send that data along when the button i...
I'm in need of getting a random record from a table via ActiveRecord. I've followed the example from Jamis Buck from 2006.
However, I've also come across another way via a Google search (can't attribute with a link due to new user restrictions):
rand_id = rand(Model.count)
rand_record = Model.first(:conditions => [ "id >= ?", rand_id...
Here's a story:
User A should be able to upload an image.
User A should be able to set a privacy. ("Public" or "Private").
User B should not be able to access "Private" images of User A.
I'm planning to user Paperclip for dealing with uploads.
If I store the images under "RAILS_ROOT/public/images", anyone who could guess the name of...
I have three models:
User
Award
Trophy
The associations are:
User has many awards
Trophy has many awards
Award belongs to user
Award belongs to trophy
User has many trophies through awards
Therefore, user_id is a fk in awards, and trophy_id is a fk in awards.
In the Trophy model, which is an STI model, there's a trophy_type colu...
Hello, i followed this tutorial fo setting Autlogic up properly. So, my site needs a form of level, like "Admin", "Moderator", "User", "Guest". So Admins can do everything, where Moderators may not can make site changes. And Users can't destroy, Update or Create.
I've have googled a bit.. But nothing found, so i thought you guys might ...
I have the need to do the following in Rails to mirror a desktop application:
a User and an Office 'owns' a record, if you don't own the record on a user or office level you're kicked into the public realm.
user gets read,write,delete to the model record
office gets read/write/delete to the model record
other or public gets read/write/...
Hello,
I know that question with same title has been asked almost 6 month ago.
I have Googled for this problem and I have not found any working solution.
Has there been any fixes for this very critical problem?
I need to get my website running ASAP. Just to get the site up and running I'm even ready to add utf8 conversion methods to ...
Hi, anybody, please, help me with Thinking_sphinx configuration.
I have table profile1, which has_one profile2 and profile3.
So i just need to index them both, but i can't.
I tried
indexes name
indexes profile2(:name), :as => :profile2_name
indexes profile3(:name), :as => :profile3_name
has id
What i m doing wrong?
Thanks.
...
I'm designing a question-and-answer Ruby on Rails application.
After a user logs in, you can see a list of questions posed by other users. I have a link next to each of the questions to /answers/new?question_id=someNumber. That links to a page that displays the question (to remind the "answerer") above a standard form for submitting you...
I want to use auto-completion in a number of fields (5-7) in my forms. There is a screencast on auto-completion with Prototype library by Ryan Bates ( http://railscasts.com/episodes/102-auto-complete-association). On the other hand, I have noticed that quite many guys suggest jQuery for this task ( http://jquery.bassistance.de/autocomple...
I'm using periodically_call_remote to update a portion of a page that contains a list of objects. I send along with the url a param containing the created_at date for the most recent object in the database. The action that is called then get all the objects that have been created since then and renders a partial which displays them at th...
Hi all,
I tried to use Devise 1.0.6 over Rails 2.3. I followed the installation instructions and the user can successfully sign up. However, when I use the registered user account to sign in, the password field is cleared up and nothing happened. Could anyone give me some ideas? Thanks in advance.
...
We are evaluating plugins for Authorization in Rails. The two at the top of our list are
cancan and declarative_authorization.
I would like to get some feedback from anyone currently using either of these plugins.
The problem we are going to face with any authorization plugin is that we have a
database per customer model and will ...
Hi!
Is it good when url to show and destroy are same? How it can be changed in RoR if i want continue use standard tools like script/generate scaffold ?
Thanks.
...
Hi!
I'd like to spec the fact that my application layout view prints out flash notices. However the following code does not run, the flash method does not exist in view specs (as opposed to controller specs where it works perfectly):
describe 'layouts/application' do
it "renders flash notices" do
flash[:notice] = "This is a notic...
What happened to asset_host in rails 3?
Earlier I can put following code into development.rb and get all assets not present on development:
ActionController::Base.asset_host = proc do |source, request|
unless File.exist?(File.join(RAILS_ROOT, 'public', source.sub(/\?\d+$/, '')))
'http://example.com'
end
end
But in rails 3 ther...