similar to: aasm manage states

Displaying 20 results from an estimated 4000 matches similar to: "aasm manage states"

2009 May 05
4
modalbox rails var interpolation
Howdy everyone. I am using modalbox which is very nice an easy to use. I have this for an edit for a company listing: <td><%= link_to(''Manage Companies'', {}, :onclick => ''Modalbox.show(\''/ companies/edit/#{company.id}\'', {width: 600}); return false;'') %></td> The link is not putting the company.id in it puts #{
2009 Oct 31
1
How to changing a AASM state using a Edit Action+Form View?
Hello there, I''m using AASM to manage states in my User model. I want to change the status through the edit action. To do this I''m using the method User.aasm_states_for_select in my form to populate the select input for states. When I hit the button commit all the changes are saved, including the state name. But the AASM event for that state is not called, it is happening
2010 Dec 20
11
rails code to sql
Is there a relatively easy way to do this code in sql? @categories=Category.all.reject{|n| n.blank?}.sort{|a,b| a.name <=>b.name}.collect{|t| [t.name,t.name.downcase.gsub('' '',''_'')]} -- 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
2009 Jul 19
3
Edit function now outputs HTML only
For some reason my new action works fine but my edit outputs nothing but raw HTML. Anyone have any ideas?
2008 Oct 28
7
aasm callback order?
Hello! Sometime ago I ran across a webpage where someone had identified the full callback sequence for an object lifecycle including AASM with it''s :enter and :exit and whatnot callbacks. Unfortunately, I can''t find it and searches don''t seem to help. Does anyone have a reference to a page that shows the callback sequence with Acts As State Machine (the gem)? I think
2010 Nov 22
0
aasm code into module
Is it posible to move big aasm code into a module and then include it into a class and it work correctly? -- 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 to
2009 Mar 03
2
Looks like a bug - Ruby1.9.1Rails2.3.0 - script/plugin
I started talking this one up yesterday - I''ve gotten as close to a good problem statement as I can. 1) script/about: Ruby version 1.9.1 (powerpc-darwin9.6.0) RubyGems version 1.3.1 Rails version 2.3.0 Active Record version 2.3.0 Action Pack version 2.3.0 Active Resource version 2.3.0 Action Mailer version 2.3.0 Active Support version
2009 Oct 08
6
Eager Loading a Relationship That Has No PK/FK
I''m attempting to wrestle an old DB into Rails. This relationship is giving me trouble: class Show < AR::Base has_many :segments end class Segment < AR::Base belongs_to :show has_one :media #this has no PK/FK relation end A Segment is "linked" to Media by Media.name, which is the result of concatenating Segment.name and Segment.part. As I said there are is no
2011 May 03
2
Database performance for polymorphic associations under high load
Hey guys, I''ve been thinking lately about polymorphic associations, and I wonder: is there a noticeable or tangible performance "hit" from doing polymorphic associations when you''ve got your database under really high query load? So for example, maybe I have a "message" model, a "user" model and an "administrator" model, without any
2010 Mar 30
2
setting up has_many
Do I have to manually set a column in a dependent table for the id of the object to which it belongs? I have a collection of objects called photos that are owned by a analysis object. When I try to show an attribute of each of the photo objects I get this error: Mysql::Error: Unknown column ''photos.analysis_id'' in ''where clause'': SELECT * FROM `photos` WHERE
2010 Aug 02
1
Drop down boxes from table data
Hi I have another question for how best to do this. Now I have been following the tutorial at: http://www.tunaslut.com/learning-ruby-drop-down-lists-in-one-to-many-relationships, however when I change the view over from <% @cities.each do |city| %> <tr> <td><%=h city.city_name %></td> <td><%=h city.country_id %></td> to: <%
2010 Dec 10
2
has_many, conditions overrride
I have a prod site that has: has_many :data, :conditions => {:aasm => ''active'') I do not want to modify it as I do not want to break existing functionality Is there a way to overrride this at runtime? -- 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 27
14
[rails] undefined method `model_name' for NilClass:Class
Never seen the error above before, code: describe "edit action" do it "edit action should render edit template" do food = Food.create(:name=>''mooo'') # Food.any_instance.stubs(:valid?).returns(true) get :edit, :id => food.id response.should render_template(:edit) end end -------------- next part
2009 Jun 10
5
uninitialized constant ActiveSupport::Cache (NameError)
Hi After having updated some GEMS I get `load_missing_constant'': uninitialized constant ActiveSupport::Cache (NameError) on starting the server of a freshly generated rails project. Before, I already had Rails 2.3.2 projects succesfully running, now all of them generate this error. These are my GEMS: actionmailer (2.3.2, 2.2.2, 2.1.2, 2.1.1, 2.1.0) actionpack (2.3.2, 2.2.2, 2.1.2,
2011 Jan 02
6
Database Design
Hello, I have a user table that stores their username, email address, and password. (along with salt, etc) However, now I want to have more complex information associated with each user (address, etc). I''m no DBA expert, so in terms of performance, which is better: - A user table that has all the fields in it (Username, Email, password, country, state, zipcode, etc) - A user table that
2010 Aug 18
6
Once I added this HABTM, one of my 'through' relationships, on a non-habtm model, seems to have broke?
I''m a rails newb and have been Googling about this, but I''m still stumped. Not showing everything here, but basically it should be a pretty common setup so I''m sure others know what I''m doing wrong. - A meter can belong to many meter_groups - A meter_group can have many meters. - A user can ''subscribe'' to viewing a meter_group (Subscription)
2009 Dec 06
3
link_to_function or button_to_function memory usage
I have an full ajax app doing crud operations for contact info for one section. I was using ajax calls to edit and cancel and also to add a contact. I am implementing a button_to_function instead of doing an ajax call to just edit/add/or cancel a contact. I am running into a memory issue using the button_to_function or link_to_function. I have this: <%= link_to_function ''Edit
2008 Sep 08
2
Restful Authentication and State Machine state transfer question
I''m adding some code to a project using restful_authentication and acts_as_statemachine In the create method for a user there is the following code generated by the restful_authentication template @user.regster! if user.valid? And this will save and the user record if it is valid. I understand that the statemachine will then change the state from passive to pending. It will guard
2006 Oct 25
12
NameError, uninitialized constant States
I''m completely new to Ruby and Rails and could use some help resolving an issue. I have a list method that is supposed to show the titles and states(status) of requests, but I get an error from this piece of code: <td><%= change.states.state %></td> The error is: c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in
2011 Feb 26
1
How to manage the form of a model that has two foreign keys
Hi, Basically I have two models: User and Godfather. The godfather table has three columns: - user_id (FK --> User) - user_godfather_id (FK --> User) - description (text) Inside each model class, I am adding the following associations: class User < ActiveRecord::Base has_many :godfathers # for user_id has_many :godfathers, :foreign_key =>