Displaying 20 results from an estimated 100000 matches similar to: "Update form after changing model with migration"
2011 Apr 01
4
add_column not working in migration for sqlite3
Hello,
I developed an app with postgres DB but want to change the DB to
sqlite3. I changed the database adapter in the database.yml file. When I
run the migration most of it was successful but add_column was throwing
an error
"Cannot add a NOT NULL column with default value NULL: ALTER TABLE
"rates" ADD "customer_id" integer NOT NULL".
I made the modification and
2013 Jun 21
1
How to create Migration from Mysql DB with bigint type of Mysql
I have to create Migration file form Mysql DB
But I want type of Migration equivalent with Mysql DB
(example : in Mysql with type Bigint and in Migration will have type
Int(20) or Bigint)
Could You help me solve this Problem?
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
2010 Aug 16
2
Form validation and processing w/o model (no Db/ActiveRecord)
All -
Trying not to fight rails on this, basically have a form and all the same as
would be with an ActiveRecord model except that there is no table. I started
out using this article:
http://stackoverflow.com/questions/315850/rails-model-without-database
...which is kind of a hack by inheriting ActiveRecord in to non-AR model but
am running into some problems and just have the feeling that I am
2012 Apr 11
1
multi model form
hi,
can someone advice how can I create a form with fileds from different
models.
also how to get the different models (objects) saved.
thank you
dani
--
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 May 20
3
How to handle non model data in form?
Hey,
I got a form which looks like this:
- form_for(@article, :html => {:multipart => true}, :url =>
articles_path) do |f|
= errors_for(@article)
.field
= f.label :text
%br
= f.text_field :text
.field
= f.label :author_id
%br
= f.text_field :author_id
.actions
= f.submit
But since I don''t want anyone to type in an author id I changed it
2010 Mar 19
2
migration
Hi all,
I have migrated with some tables in my application. After some days i
need to add few more tables to database. The initial tables in database
have some data. when i try to migrate the database for second time with
rake db:migrate it is saying the alredy table exist <table name> and
rake is aborted. i dont want to loose the old data and i want to add new
tables to alredy exiested
2011 Mar 02
4
migrations in rails?
Are migrations used only when you''re making changes to a database? Does
it just allow the developer to avoid using raw SQL when working with
databases?
--
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
2010 Feb 24
4
"Sequence does not exist" for joined model
Hello all,
I''m in my 5th month on Ruby on Rails and still learning.
I have an application that works fine in sqlite3 and then the boss says
he wants it migrated to Oracle.
Now, I know very little about Oracle, enough to get into trouble.
When I did the migration everything went haywire. Well, I''ve refactored
several problems and now I have another.
I have two models with a
2013 May 07
4
Rake db:migrate
Hello,
I''m trying to use command rake db:migrate, but in MySQL I continuous get
an empty set and I do know why.
#/db/seeds.rb
User.create(username: "lorenz", password: "mypass", admin: true)
When I run:
rake db:seed RAILS_ENV=development --trace
I received:
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
**
2011 Aug 23
12
remove a table with migration
HI, guys,
How to remove a table with migration, i saw a drop down method in
migration created file , how can i use that ?
thank you.
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email
2011 May 04
1
Why do I sometimes have to refresh the page manually after an AJAX form submission?
When I do remote form submits through jQuery .submit() why do I
sometimes have to refresh the page manually to see the results?
My jQuery handler is very simple:
$("#vote_yes").click(function() {
$("#approval").val(true)
$(".edit_vote").submit()
});
And the link that leverages this bit of code is as follows:
<%= link_to("Vote
2011 May 15
3
Rails 3 and saving decimal values from a form
I have an odd bug in one of my applications. When I am using the
sqlite3 database the bug is not present. However when I use mysql2 as
the database adapter I run into an error saving decimal values from a
form. If I submit the value 19.99 my input after the decimal is
removed and it is stored in the database as 19.00
What would cause this? The database has the correct settings for the
column and
2012 Jul 21
3
Attributes in classes db/migrate or app/models
Hello,
I''ve got some experience in Java, and recently, I''ve begun to practice
with Rails.
One of the things that has surprised to me, after I''ve read some books,
it''s that classes hasn''t got attributes; the attributes are in the files
db/migrate/*. After that, the ORM makes the mapping with de Database.
But the attributes aren''t in the files
2010 May 18
4
When I do a migration, the changes are make in the test db
When I do a migration, the changes are make in the test database. Does
anyone know the reason?
In the config/environment.rb file, I have this: ENV[''RAILS_ENV''] ||=
''production''
And in the db/ folder, it creates a file named test.sqlite3
When I did the migrations, RoR used the test database, but when I want
to make something in the application, the migrations
2012 Jan 10
5
6 fundamental migration problems for beginners
## Hi ##
I have 6 simple and fundamental Problem in RoR migration and although I
googled it and read many article about it and research it for a week , I
didn''t understand it. please help me for these problems :
----------
1 - When I create a model (for example "rails generate model
Football_League") , I see in db/migration a "create_football_leagues.rb"
. I want
2012 Mar 04
3
Which command run after change Models
Hi:
I''m reading and learning from the Rails tutorial at [1] but not building
the sample application instead I''m trying to build my own. After
generate all the migration and build the main classes for Models I made
some modifications to them in order to build relationship between tables
now I think that I need to run some command to generate the scaffold
again with proper
2010 Aug 30
1
update form text_field on collection_select selection
I have form and a collection_select control. I would like to update
form fields (text box) when I select an item from the collection_select
box.
It''s like selecting template from the collection_select and the template
automatically loads to text boxes.
Any help?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
2010 Mar 01
3
has_many models in a form
Hi, guys.
There are four models in the program, A has_many B through C, B has_many
A through C, A has_many D, D belongs_to A. I have a form to create A.
Inspired by Ryan Bates'' railscasts I was able to create A and D in the
same form, and link A to B(created beforehand) through C in the same
form as well. Is it possible to create A and B in the same form?
Thanks in advance.
--
Posted
2011 Apr 07
3
Need help in changing data in production.
Hi everybody,
I have to change a lot of data in production server and I don''t know what''s
the best way to do it.
To handle the permissions in the older version of my system I had two
models: Group and Permision.
class Group < ActiveRecord::Base
has_many :actions
end
class Permission < ActiveRecord::Base
belongs_to :group
PERMISSION_NAMES = "..."
end
I
2011 Apr 08
3
Ruby on rails migration problem
Hello all,
I have created a migration add_details _to users ... ( city_id ,
profession )
and then migrated it..
when i use params[:user] to update the database by taking user inputs
from forms in views, it is not updating the database for these city_id
and profession... ( not changing from null )
if add validation for presence of city_id .. it is giving the error
"City id cant be