Hello I'm using ryan Bates railscast on HABTM checkboxes.... I looking for the way to call a specific record from the set, allow me to explain.
In my view I have
<% for interest in Interest.find(:all) %>
<div>
<%= check_box_tag "user[interest_ids][]", interest.id, @user.interests.include?(interest) %>
<%= interest.name %>
</di...
Hello all, I have read through all relevant posts on Prawn but found no mentioning (even in Prawn's own documentation) of headers and footers.
However, I did see a demo on Prawnto's own website about headers and footers. I copied the entire source of that demo just to see if it works but an error of undefined method "header" is complai...
I'm trying to set up a new project for a music site. I'm learning ROR and am a bit confused about how to make join models/tables. Does this look right?
I have users, playlists, songs, and comments. Users can have multiple playlists. Users can have multiple comments on their profile. Playlists can have multiple songs. Playlists can have ...
Hi,
I Have a HTML document with links links, for exemple:
<html>
<body>
<ul>
<li><a href="http://someurl.com/etc/etc">teste1</a></li>
<li><a href="http://someurl.com/etc/etc">teste2</a></li>
<li><a href="http://someurl.com/etc/etc">teste3</a></li>
<ul>
</body>
</html...
Within Authlogic, is there a way that I can add conditions to the authentication method? I know by using the find_by_login_method I can specify another method to use, but when I use this I need to pass another parameter since the find_by_login_method method only passes the parameter that is deemed the 'login_field'.
What I need to do i...
Update:
Originally, this post was using Books as the example entity, with
Books1, Books2, etc. being the
separated table. I think this was a
bit confusing, so I've changed the
example entity to be "private
todo_items created by a particular
user."
This kind of makes Horace and Ryan's original comments seem a bit ...
I have a model that has paperclip attachments.
The model might be used in multiple rails apps
I need to return a full (non-relative) url to the attachment as part of a JSON API being consumed elsewhere.
I'd like to abstract the paperclip aspect and have a simple virtual attribute like this:
def thumbnail_url
self.photo.url(:thu...
Where do you host your rails applications? I've tried Heroku and Slicehost. I thought I would ask you, the knowledgeable guys here at stack-overflow, for hosting recommendations.
Thanks in advance
-- Deb
...
I'm having difficultly adding querystring parameters to link_to UrlHelper. I have an Index view, for example, that has UI elements for sorting, filtering, and pagination (via will_paginate). The will_paginate plugin manages the intra-page persistence of querystring parameters correctly.
Is there an automatic mechanism to add the query...
Hello,
I have a form that has two field (time_selects), the idea is that the user can select the beginning of a call and end time of the call.
I've setup a observe field and works fine:
<%= observe_field "llamada_inicio_4i", :update => "total", :with => "llamada_inicio_4i",
:url => { :controller => "llamadas", :action => "time_tr...
I have built a blog application w/ ruby on rails and I am trying to implement a search feature. The blog application allows for users to tag posts. The tags are created in their own table and belong_to :post. When a tag is created, so is a record in the tag table where the name of the tag is tag_name and associated by post_id. Tags are s...
I have a nested form in a rails view that is called like this
<% f.fields_for :invoice_item_numbers do |item_no_form| %>
<%= render 'invoice_item_number', :f => item_no_form %>
<% end %>
and the partial (_invoice_item_number.html.erb) looks like this
<div class='invoice_item_numbers'>
<% if f.object.new_record? %>
<li><%=...
So, I've got bluecloth installed and I'm trying to use the Control.TextArea javascript WYSIWYG editor.
Anyways, I followed the tutorial on the page and when I load the corresponding view, I get an error:
uncaught exception: Control.TextArea requires Object.Event to be loaded.
This comes from Control.TextArea js file.
Any ideas? Tha...
Hi All,
I am using recurring facility of authorized.net using active_merchant plugin in rails.
there are two payment method for this
1] Credit Card
2] Bank Account
I successfully done it using Credit Card
For Recurring i need my Test Mode off.
Also my E-check, credit card processing, and subscriptions are all enabled.
But i am not...
I was working on PHP in the past 1 year and nowadays I'm learning Rails.
In rails:--
Routing takes an incoming URL and decodes it into a set of parameters that are used by Rails to dispatch to the appropriate controller and action
For example
rs.recognize_path "/blog/show/123"
{:controller=>"blog", :action=>"show", :id=>"123"}
Am ...
Within my controller specs I am stubbing out valid? for some routing tests, (based on Ryan Bates nifty_scaffold) as follows :-
it "create action should render new template when model is invalid" do
Company.any_instance.stubs(:valid?).returns(false)
post :create
response.should render_template(:new)
end
This is fine when I test t...
The following are the models and association.
class Vendor < ActiveRecord::Base
attr_accessible :name, :address_attributes
has_many :campaigns
has_many :clients, :through => :campaigns
end
class Client < ActiveRecord::Base
attr_accessible :name
has_many :campaigns
has_many :vendors, :through => :campaigns
end
class Campaig...
Hi Everyone,
I have installed the Paperclip plugin to attempt to upload an avatar for my kase model. For some reason, the select the file button shows, and I can choose a file - but then when I click update the kase - it takes me to the show page, but the missing.png rather than the selected image.
kase.rb
class Kase < ActiveRecord::...
i am trying to simulate a session using factory girl/shoulda (it worked with fixtures but i am having problems with using factories). i have following factories (user login and email both have 'unique' validations):
Factory.define :user do |u|
u.login 'quentin'
u.email '[email protected]'
end
Factory.define :session_user, :class =...
Hey,
I want to export some data from my jruby on rails webapp to excel, so I create a csv string and send it as a download to the client using
send_data(text, :filename => "file.csv", :type => "text/csv; charset=CP1252", :encoding => "CP1252")
The file seems to be in UTF-8 which Excel cannot read correctly. I googled the problem and f...