This seems like a classic rails situation: I want to have a my index action display a sortable table of the items. I've looked at (and hacked at) some plugins, notably thoughbot's sortable_table and Michael Kovacs's sortable (the latter I have forked and improved). However, now I'm finding that sortable is somewhat incompatible with inhe...
I'm building a multi-step form in rails. It's not javascript driven, so each page has its own controller action like "step1" "step2" etc. I know how to do multi-step wizards through JQuery but I don't know how to keep rails validations per page without getting into javascript, hence this way.
Anyways, my model is a User object but I'm...
in the dom in my tinyMCE editor i see
<p>
<i>testing 123</i>
</p>
but when i run
tinyMCE.activeEditor.getContent()
it returns
<p>
<em>testing 123</em>
</p>
Why is it changing <i> into <em>? Im having problems with this because i want to insert text dynamically that is surrounded with tags and things are getting confusing....
Hi all,
I have a rails app and I run the main rails app on a mongrel server. However, I also have an comet server (using EventMachine) running using the rails environment (so it can access the database). However, Mongrel seems to mess up EventMachine. My question is, how can I detect whether or not I am running the rails environment fro...
Ive been learning PHP and tried to get into RoR and the two are always compared.My question is, is there a PHP include equivalent for Ruby on Rails. To me the ability to include PHP files is it's most valuable feature.
...
Does Rails provide a way to execute code on the server after the view is rendered and after the response is sent to the browser?
I have an action in my application that performs a lot of database transactions, which results in a slow response time for the user. What I'd like is to (1) perform some computations, (2) send the results of ...
Does Rails 3 have anything akin to slices in Merb, or areas in Django where there is a layer of organization above the controller? I heard at some point that they may allow hosting one rails app within another but I can't find any information on that in the pre-release material. Any hints on how to do something like this?
...
My users have and belong to many roles, and likewise my roles have and belong to many users.
How can I select all users who have the role "editor"? How can I select all users who have only the role "editor"?
...
I'm working on a Rails application that uses prawn to generate PDF's. Long story short, we want to be able to digitally sign generated PDF's. Im not sure where to start reading up exactly. Just wanted to ask if anybody else has been able to accomplish this before, and if so, what kind of resources I should be using to do it.
Thanks!
...
My goal is to enable a user to be able to submit multiple NewsImages from a parent Blog form.
My Blog model looks like this:
# == Schema Information
# Schema version: 20091006171847
#
# Table name: blogs
#
# id :integer(4) not null, primary key
# title :string(255)
# body :text
# profile_id :inte...
I recently switched from restful_authentication to authlogic for authenticating users for my application. I've been exploring the API, and I've found a helper for generalizing error messages and overriding the message with my own, but I was curious as to how you can remove these two lines:
1 error prohibited this user session
from ...
Let's say I have the simple rails blog app.
And I have a custom action, like page_views which shows the number of views of the post.
class PostsController < ApplicationController
def page_views
#show some page views
end
end
And there is also an associated view in the app/views/Posts folder.
Now, in the routes.rb I have:...
I've got a model named Song with
has_many :genre_songs, :dependent => :destroy
I've got a join model GenreSong (with genre_id and song_id) that I want to destroy when the Song records are deleted.
It appears that rails is looking for a primary key to delete in the GenreSong model, since I get this error:
Mysql::Error: Unknown colum...
Hi everyone!
I have three relevant models: Companies, Projects, and Links, and I am trying to create a system where we generate routes according to the Links they create, for example:
www.site.com/the_company's_specific_path/one_of_company's_links
One company has_many :projects, one project has_many :links.
Summary of the structure:...
i've read this article for ajax indexing
how can i do to read the state in a url like this with rails?
ex.
http://mysite.com/controller/action#!pid=1237604&id=1079297234
the state is:
pid=1237604&id=1079297234
thanks
...
We have a user model which :has_one detail. In a form_for a user, I want a drop-down to select the user's details' time_zone.
I've tried
<% form_for @user do |f| %>
... user stuff ...
<%= f.select :"detail.time_zone", ...other args... %>
<% end %>
but I get a NoMethodError for detail.time_zone. What's the correct syntax fo...
I'm using devise with the facebooker plugin.
What is the best option to make a "like_it" button on my webpage without the iframe approach ?
I have
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/Featu...
Why
has_many :line_items, :dependent => destroy
in the cart.rb model file causing failed tests
I have been working through the "Agile Web Development with Rails" book and am about half way through the depot application (I did skip around a bit).
When I go to run the default test ("the truth") I get failed tests. Trace says
"/Use...
hey,
i have a simple associations:
class Account < ActiveRecord::Base
has_many :users
accepts_nested_attributes_for :users
validates_presence_of :users
end
and
class User < ActiveRecord::Base
belongs_to :account
end
i just want to run a simple test:
describe 'a new', Account do
it 'should be valid' do
Factory.buil...
Hi,
I'm a PC guy and a Microsoft Platform Developer. I've got a new assignment from my client whiche has to be develop with open source technologies. Hhas already send me server information where I've to deploy. The hosting information he has given is CentOS environment with Ruby (with Rails) and Python support. I've chosen Ruby becaus...