I have a Rails app with Users, and each user HABTM Roles.
I want to select Users without a specific role. I have searchlogic at my disposal, and I'm lost. I've tried using a combination of conditions and joins and includes and what not, but I can't seem to nail it. This works:
User.find(:all, :conditions => ['role_id != ?', Role[:admin...
Hello all,
I am about to be writing a Ruby on Rails app which will use sub-domains to authenticate users. We will have two types of accounts:
user accounts
domain accounts
Users will thus be able to belong to multiple domain accounts using the same credentials. I hope to have the ability for a domain account administrator to be able...
I've been pulling my hair out trying to work with Time in Rails. Basically I need to set all time output (core as well as ActiveSupport) to the server's local time -- no GMT, no UTC, etc. I've seen various posts relating to Time, but they usually involve someone's need to set it for each user. Mine isn't nearly as complex, I simply wa...
I am using Rails 2.3 and I decided to provide support for JSONP. Created a brand new application. Then ran script/generate scaffold User name:string
This is my entire environment.rb
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
require 'rack/contrib'
Rails::Initializer.r...
EDIT: Figured it out so asking a related question.
here's my Javascript
jQuery.ajaxSetup({
'beforeSend': function(xhr) {
xhr.setRequestHeader("Accept", "text/javascript")
}
})
jQuery.fn.submitWithAjax = function() {
this.submit(function() {
$.post(this.action, $(this).serialize(), null, "script");
r...
I am using solr with ruby on rails.
It's all working well, I just need to know if there's any existing code to sanitize user input, like a query starting with ? or *
...
Hi,
The following link
<%= link_to "Login to comment", :url => new_session_url(:return_to => request.request_uri, :anchor => 'commentForm'), :method => :get, :html => { :id => 'login_to_comment'} %>
generates the following url:
http://localhost:3000/session/new?return_to=%2Fnature_photos%2Fsdfds#commentForm
and the parameters are ...
I just upgraded to Rails 2.3.2.1 running Litespeed web server 4.0.5 and get the below error. I think it has something to do with setting up the Rack preference (server = Rack::Handler::LSWS) but not sure how to do it.
Also, I'm running the lateast ruby-lsapi
[root@idev logs]# gem list ruby-lsapi
ruby-lsapi (3.5, 3.3, 3.2)
2009...
Anyone using JRUBY on Rails with FeedTools? I'm getting the following error when I try to run FeedTools: NameError (undefined local variable or method `parser' for YAML:Module):.
I've tracked the code down to monkey_patch.rb. It is bombing on the parser line, but I'm new to Ruby and Rails and couldn't debug it on my own. What's weird ...
Hello everyone,
I am to build a web application which will accept different events from external sources and present them quickly to the user for further actions. I want to use Ruby on Rails for the web application. This project is a internal development project. I would prefer simple and easy to use solutions for rapid development over...
I'm new to development, and I'm getting into it as a hobby. (currently a student).
I'm wondering what you guys and girls advise.
There's greater support for PHP, I realize. But Ruby looks like it offers a great deal more flexibility...and it's prettier.
This is a question from a noob, so if this is a bad question, please excuse me!
...
Let's say I am using a STI pattern to persist several different subclasses of "Transaction," which subclasses "ActiveRecord"
My subclasses might include "HighPriorityTransaction" and "LowPriorityTransaction" which rails will store in the table "transactions" with a "type" column. Each subclass has a different implementation of the befor...
I currently have a hideous delay based chat app in my learning management system (rails based) but want to explore other options. The jabber approach seems cool, and there is can_has_chat, but on their google code page there is a notice about the potential for trouble with many sleeping mongrel instances. Doesn't seem like a good way to ...
I have an action that searches records based on a url parameter. The url for the action looks something like this:
http://domain.com/records/filter/<filtercode>
If the user enters an incorrect filtercode, I would like to app to
raise an error so that Hoptoad will report to error to me.
render a 404 instead of a 500 in producti...
I'm trying to contact a REST API using ActiveResource on Rails 2.3.2.
I'm attempting to use the timeout functionality so that if the resource I'm contacting is down I can fail quickly - I'm doing this with the following:
class WorkspaceResource < ActiveResource::Base
self.timeout = 5
self.site = "http://mysite.com/restAPI"
end
Ho...
Hello,
I would like to validate my users, so they can only use a-z and - in their username.
validates_format_of :username, :with => /[a-z]/
However this rule also allows spaces ._@
Username should use only letters, numbers, spaces, and .-_@ please.
Any ideas?
Best regards.
Asbjørn Morell
...
Do you have a suggestion of a CMS writeten in Ruby on Rails. I need it for a corporate intranet. I am new to RoR, I am a PHP programmer, so it is better for me not to start from scratch.
...
I have 2 rails apps on the same domain. i want the single sign on feature to be added to them. i would prefer to maintain separate database for each app..
Can anyone please tell me how to do this?
Thanks in advance,
Ak
...
I am using awesome_nested_set but I guess this applies to all the nested_set plugins equally.
When I add a child I want that child to inherit some attributes from the parent. Sounds simple, it certainly is with acts_as_tree. The problem is you need to save the object before adding to the parent, so at least initially you end up with a r...
Hi,
I had a previous question that touched this topic (http://stackoverflow.com/questions/1131694/rails-how-to-get-value-from-another-field-when-executing-an-onchange-remote-func), but then I dugg a little deeper and realized that my problem is the datetime_select method.
I have a textfield with onchange. In the onchange I need to get ...