Displaying 20 results from an estimated 6000 matches similar to: "How do you update HABTM relationships or create."
2010 Jun 09
3
rake tells me to install gems that are already there
Hi, I''ve on hostmonster.com and i''ve run into a small problem that I
just can''t get. When I push my application into my hosting environment
and try to run rake db:migrate, I get an error message from rake
telling me to install the missing gem my environment.rb file has:
config.gem "formtastic"
config.gem "authlogic"
So I installed them but I still
2010 Sep 09
17
formtastic issue
Hello,
I will try to explain it step by step :-)
I just created a new rails 3 app, then I created a new controller...
rails generate controller admin::users
I didn''t forget to add the resources in the routes.rb file like this.
namespace :admin do
resources :users
end
Now I try to use formtastic to create the form but I get erorr that my
users_path doesn''t exist?
2009 May 13
3
free sms gateway in india
Hi,
I am Ramu from India, My rails application needs to have sms
feature I searched for couple of rails plugins like sms-fu and all.
But it seems that none of them has a support to india mobiles. Please
help me in finding out the free sms plugin for rails in india.
Thanks,
Ramu.
2012 Sep 22
1
formtastic does not save at all
Rails 3.1.3
I am using Formtastic gem in order to deal with multi-select
dependencies.
<%= semantic_form_for(@give) do |f| %>
<%= f.inputs do %>
<%= f.input :departure,
:collection => Departure.find(:all, :order=>:city).collect{ |c|
[c.city,c.id]},
:required=>true %>
<div id="destinationCity">
<%= render :partial =>
2010 Jan 20
0
need help with nested forms and habtm
Hi,
I''m currently stuck with a problem I just can''t find a clever solution
for. I checked every tutorial, issuetracker, API reference I could
find but found nothing to "enlighten" me --> I desperately need your
help :-).
My Question is: is it possible to use nested forms for habtm
associations?
--> Here some more info about what I wanted to do and what failed
2009 Jun 22
5
has_many through , or habtm , using form
i think there ara two ways of relate products and categories ,
basically i want to fix one product(e.g hp dv7....) to some categories
(notebook,17"notebooks...)
i made a table named categorization(incuding category_id,product_id
fields) then in models i write these codes below
class Product < ActiveRecord::Base
has_many :categories, :through => :categorizations
2009 Jul 29
3
Use of Ruby Gem and Plugin
Hi,
I need to know what should we use in ROR application
gems or plugins.
Which is the best for any ROR application?
Can anyone brief me about this.
Thanks
--
Posted via http://www.ruby-forum.com/.
2009 Jul 19
9
Equipment_URL Failed to Generate (new_equipment_path)
I''m trying to use new_equipment_path, which creates the appropriate
link. But, when trying to evaluate "equipment/new" I get the error
below. I''ve included my routes (rake route). Equipment is one of those
words that pluralizes to "equipment", so the singular is right (from
what I know from this forum.
Any help would be appreciated.
Error:
equipment_url
2009 Oct 28
6
undefined method `^' for "e":String
I''m attempting to learn Ruby on Rails, but these errors aren''t helping.
I''m currently trying to follow the lessons available on
www.learningrails.com. I received this error after trying to visit a
page generated by using the scaffold command. Actually, this is all I
did up until the error:
rails sample2 -d mysql
mysqladmin -u root -p create sample2_development
ruby
2009 Jul 17
3
how to get "www.site.com/user1" address
Hi,
I am a newcomer to the Rails Front. Currently reading chapter 17 of
Agile Web Development on Rails. But a burning question, that I would
appreciate anyone being able to verify for me!
Here goes:
What I am hoping of trying to build is a site where I can have a page
for individual entry in the database. So if it were users: I wanted to
have a page in the the format: www.example.com/user1
2010 Aug 17
2
[Form] Method POST & PUT problem
Hello,
I have a form that should be a POST method, but Rails insist to put a
hidden field "_method" that has the value "put" does anyone knows why?
Thanks,
David Sousa
Controller: -------------------------------
def new
@user = @current_user
end
-------------------------------------------
View: -------------------------------------
<% semantic_form_for @user,
2006 Jun 29
2
HABTM with multiple select list
Hello,
I am very new to ruby and need to create my first HABTM with multiple
select list.
I am having problems saving data in the middle(linking)
table.
1. titles can have multiple categories
2. categories can have multiple titles
Categories, titles and categories_titles tables are created.
----- title_controller.rb--
def new
@title = Title.new
@categories =
2010 Jan 16
3
Formtastic and Access to Variables of Nested Model
So I''m not even sure if I''ll be able to properly explain what I''m
trying to do, but I''ll do my best.
Let''s say that I have two models: Document and Option.
A Document has many Options (and, by extension, an Option belongs to a
Document).
Each document may have a different number of options, hence why I made
it a separate model.
Each document has the
2010 Jun 14
2
stylesheet_link_tag
I know that the following statement loads the scaffold stylesheet, but
what exactly does stylesheet_link_tag do here?
<%= stylesheet_link_tag ''scaffold'' %>
Thanks.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2011 Feb 17
16
Unindent ERB output
Hi all,
I''d like to unindent a block of ERB specifically to combat the extra
spacing being added to content inside <textarea> by the browser. Is
there such a feature in ERB?
I shall denote indentation with underscores in the pseudo code example
below.
Thanks in advance,
Khoan.
myview.erb:
<html ...>
__<%= render ''form'' %>
</html>
2010 Sep 15
5
Hide an image in show.html.erb
I have the following "show.html.erb" script, and I get as an output TWO
images since I use a method to draw an image.
How can I HIDE the RESOURCE image?
Thanks.
Here is the script:
<canvas id="line" height="512" width="512">
</canvas>
<p id="notice"><%= notice %></p>
<p>
<b> Name </b>
<%=
2012 Nov 03
0
ids writer fields for HABTM relationship.
Hello forum readers,
Let''s say i have two models: Person and Role (i replicated the problem
with Post & Tag as well, as i thought the problem was linked to some
application-specific rights problem, but it wasn''t).
In Person, attr_accessible role_ids is declared, so it accepts an array
of Role ids as an argument when creating / updating.
If i fire up the rails console and
2010 Sep 22
8
ActiveScaffold and partials
I was thinking of doing partials as I did in the simple Rails
application I worked on today.
But, since I''m using ActiveScaffold, I didn''t find any *.html.erb in the
views folder of the Rails application that I need to make my partials!
How can I work with partials in ActiveScaffold?
Thanks.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
2010 Jan 29
4
requiring records in the DB before testing
Is there any way I can require a small set of data be in the test
database before any tests are run? (unit, functional, integration,
cucumber, etc)
Any way besides using fixtures, that is.
Overload a rake task?
Modify test_helper?
Any ideas?
(Simple Case: I have to have a minimal set of user roles defined
before any users can be created)
--
You received this message because you are subscribed to
2006 May 12
2
How to declare several HABTM-relationships?
Hello,
Is it possible to have several HABTM-relationships for the same object?
Example: Imagine I have 3 objects (classroom, student, teacher) and
define the associations for the student as:
class Student < ActiveRecord::Base
has_and_belongs_to_many :classrooms
has_and_belongs_to_many :teachers
class Classroom < ActiveRecord::Base
has_and_belongs_to_many :students
class Teacher <