i want to define a many-to-many relation in a rails project. how is the best way to give the individual relations different meanings?
+------------+ has many +-------------+
| | ---------------------> | |
| person | | project |
| | <--------------------- | ...
I've noticed in various web apps that users are prompted with initial announcements to help them use the app for the first time (and users have the option to click "Don't show this message again in the future" or something similar)
Is there a plugin that does that? Or, would you simply program a many-to-many relationship between users a...
Would it be possible to translate the Ruby on Rails code base to Python?
I think many people like Python more than Ruby, but find Ruby on Rails features better (as a whole) than the ones in Python web frameworks.
So that, would it be possible? Or does Ruby on Rails utilize language-specific features that would be difficult to translate...
I am trying to do something in Rails and will admit that I'm no genius programmer, but I'm attempting to learn.
I want to create a database with user-generated entries of no specific number. The best example of what I am trying to do can be illustrated by twitter. I assume every time the user adds a new tweet it adds a row to the use...
I just checked out this answer: http://stackoverflow.com/questions/1076600/rails-recaptcha-plugin-always-returns-false
but it didn't seem to help. I'm trying to run recaptcha on rails on my local machine. The site says the API keys should work for prod and local. I've checked the keys many times and have even tried "workarounds" where y...
I'm using the friendly_id gem. I also have my routes nested:
# config/routes.rb
map.resources :users do |user|
user.resources :events
end
So I have URLs like /users/nfm/events/birthday-2009.
In my models, I want the event title to be scoped to the username, so that both nfm and mrmagoo can have events birthday-2009 without them bei...
This is probably a dumb question, but.. Any ideas how to insert BrowserCMS portlet into an actual page? What is weird, yes, I couldn't find that in their docs....
...
There doesn't appear to be any recent information about using Open ID in Ruby on Rails... the only walkthroughs that I can find do not work anymore. Does anyone know of a walkthrough or documentation that will actually work with modern versions of ruby on rails and required software?
I've been struggling with this for days and cannot ma...
Hello, I'm trying to insert a drop down menu values to a table named units and that drop values are coming from another model named properties.
Here is the schema of the units.
create_table "units", :force => true do |t|
t.string "number"
t.decimal "monthly_rent"
t.datetime "created_at"
t.datetime "updated_at"
t....
Hi,
When I try to output some data into a text file using FasterCSV, sometimes it adds the quotes to the concatenated string and sometimes it does not.
For instance:
FasterCSV.generate do |csv|
csv << ["E"+company_code]
csv << ["A"+company_name]
end
Both company_code and company_name are Strings and contains data bu...
I am trying to parse an email sent to my app server.
It should read the email to find the user by email then add the photo
to the user's photo models
Here is what I have so far. What am I doing wrong?
class Mailman < ActionMailer::Base
def receive(email)
logger.info("Got an email about: #{email.subject}")
if (@user = Us...
<% @recently_active_objects = Activity.find(:all, :limit => 10, :order => "id DESC") %>
<% @recently_active_objects.group_by{ |object| object.created_at.midnight }.each do |day, objects| %>
<h3><%= day.strftime("%A, %B %e") %></h3>
<% objects.each do |object| %>
<%= activity_message_for_activity(object) %>
...
I have a simple query to show users that are active, but somehow it is still showing inactive users. I am using sphinx. The query looks like:
User.search keywords,:conditions=>conditions, :match_mode=>:boolean, :order =>sort_order.to_s, :page => page,:per_page =>per_page
the conditions hash looks like this:
conditions = {:is_expired...
I want to generate Email from my ruby application, So i used Action mail class for that.
I configured the Email setting on environment.rb my configuration is as follows
ActionMailer::Base.raise_delivery_errors = false
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "mail.authsmtp.com",...
hi i have installed metric_fu om a rails 2.2 system running hobo and i just can't get to run the metrics command. this is my log:
$:apfcool $item rake metrics:all
(in /Users/$/Documents/apf/apfcool)
* master
/Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:171:in `process_sexp': undefined method `<' for nil:NilClass (NoMethodError)
...
I want to reload a part of a form generated with the form_for-helper via AJAX.
After reloading the part I still want to have access to the form object.
How can I do this?
Best regards
...
I have a form I wish to submit via ajax usind the jQuery $.post command.
The form looks like this:
<form action="/wine/merlot/reviews" class="new_review" id="new_review" method="post">
And the jquery call is:
$(document).ready(function() {
$('#new_review').submit(function() {
$.post($(this).attr('action'), $(this).serialize(),...
Hi
I am working on a flex application which communicates with a Rails backened.
When i request for some data, It sends back xml feed.
In some cases, if given parameters are not valid, then rails return an error feed with status code = 422 as following
email is wrong
But I dont get this feed in FaultEvent of Flex, How could i read erro...
Hi, all.
Sometimes we need form without model creation - for example search field or email, where should be send some instructions. What is the best way to create this forms? Can i create virtual model or something like this? I'd like to use formtastic, but not form_tag.
...
Hi,
A remote IP can be recive via: request.remote_ip (http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html). But is there a simple way to try to get the remote domain name (of this IP)?
Thanks
...