search for: mantat

Displaying 18 results from an estimated 18 matches for "mantat".

Did you mean: mantas
2006 Jun 08
7
How to make an OSX Finder in rails/AJAX?
I need to make a category browser that would allow nested categories. Is there any receipe on that? Currently, I use the :onchange event from one of the form element to update the first select (out of 4-5 selects), but I dont know how to elegantly reset all the child selects if I change the value from the first. All the categories are fetched from the DB and I would like a
2006 Jun 01
4
how to: update a select from another select
Hi all, I woke up at 4AM this morning to find a solution for this and it is still not working.. grrr! lost sleep for nothing! Anyways, I have 2 select list and I want the content of the second list to be updated according to what is selected in the first list. I did this in the past by having my application generate all the possible content of the second list and make some Javascript to do
2006 Jul 19
5
weird result for a custom attr reader!
Hi all, I am having a weird problem reading a value from my model. basicaly, I have these two models: class Category < ActiveRecord::Base acts_as_tree :order => "name" belongs_to :item_type has_many :specific_category_names end and class SpecificCategoryName < ActiveRecord::Base set_table_name "Specific_category_names" has_many :products belongs_to
2006 Apr 16
5
render :collection and default value
Hi all, I am having a lot of trouble to get the default value of text fields when they are generated by a partial from a collection. I have been on this for a whole week and I didnt find a single exemple on the internet of someone using a partial that generate text field with a default value. I cant believe that I am the only one having this problem. Anyone has an exemple they can show me?
2006 May 29
8
Rails and user authentification
I am a the point now where I have to add user authentification to my application. Anyone can point me toward an easy to use / secure library? I know about ActiveRBAC and was wondering if there is anything else that I should consider. Thanks! -- Posted via http://www.ruby-forum.com/.
2005 Dec 29
7
belongs_to causing NoMethodError exceptions ... ?
I''ve got a really strange problem using belongs_to. I apologize in advance for the length... this is going to take a while to explain. Basic idea: Creating a User requires that the user enter an email address and activation key that matches an existing PendingUser. After creating the user successfully, that pending user should be marked as "used". The problem: When I
2006 Jul 27
1
importing data with migration for habtm
I have 2 tables: products and categories. They are both linked by a habtm association. I have a fixture to import all the data in each table but I dont know how to import the data in the categories_products table since that table has no model, so I cant use that code: f = Fixtures.new(Category.connection, # a database connection "categories", # table name
2006 Jul 31
0
using Class#Find in dynamic fixtures
Hi, I am currently coding my tests and I made a lot of fixture files. To make everything simple (I thought), I didnt put the ID in the fixture, insted when I needed to put the id of something, I used Class.find_by_name "name of the item to find". When I use the file to import data in my migration everything is fine. But when I use the same files for my unit test, there is a
2006 Jun 05
1
:onChange and AJAX forms
Hi, I have this: <%= form_remote_tag (:update => "item_type_list", :url => {:action => :list_item_type_for_brand}, :id => "form1") %> <div> Brand <%= select :current_brand, :id, @all_brands,{},{:onchange => "submit()"} %> <input type="submit" value="Change" /> </div> <%=
2006 Jun 12
0
Using migration to import data?
Hi all, I have a large set of data to load, many of which are part of a big act_as_tree model. Right now, I am testing the creation with migration for the first layer of the tree but for the second layer, I have to know the ID of the parent_ID. So far, it is easy because I can guess it by looking at the insertion order, but I was wondering if there are any better way to do this.. Thanks!
2006 May 17
0
teardown not cleaning the BD?
Hi, I am a bit confused, I have a few functionnal tests were I add/delete records on top of the ones provided in the fixture and it seems like the records are surviving the teardown. Isnt teardown supposed to be ran after each test? So if I have something like: def teardown Client.delete_all Concept.delete_all Variation.delete_all ClientVariation.delete_all end All the
2006 May 19
1
Need help with a test
Hi, I have this controller method that I need to test: def link_concept_to_client concept_to_link = Concept.find(params[:concept_id]) # take all the variations for the concept for variation in concept_to_link.variations new_client_variation = ClientVariation.new new_client_variation.client = session[:active_client] new_client_variation.variation = variation
2006 Apr 11
1
Default value in a Partial that use index
Hi, here is my situation. I have this controler action: ---------CONTROLER-------- def list @variations = Variation.find(:all, :conditions =>["client_id = ?", @active_client.id] ) end ---------CONTROLER-------- Which call this view (removed irrelevant parts): ----------LIST.RHTML--------------
2006 Apr 30
0
weird error when running my unit tests
How can this be possible: I have two tests: def find_all_active_and_inactive assert_equal Concept.find_all_active_and_inactive.size, @concepts.size end and def test_find_all_inactive assert_equal Concept.find_all_inactive.size, (@concepts.size - Concept.find_all.size) end Concept.find_all returns 2 concepts (I overwrote the method to return only the active concepts)
2006 May 20
3
Navigation between DB Items with active Record
Hi, I am having troubles to figure out how to move from one record to the other without using <find_by_sql> or other ugly tricks. So far, I have managed to do a lot of stuff without it but I decided that I need to learn how it works this weekend! So I need your help to figure that out... I have the following 4 models: class Client < ActiveRecord::Base has_many :client_variations
2006 May 22
6
how HTML_Option works?
Hi all, all the form helpers can take a serie for options but I cant find any documentation about them. Any one can point me toward one? Or at least tell me how I can for example add a function that would be call with the onblur event from a input box? Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Apr 04
5
getting the value of a form select
I have been working for a whole week on this problem without success, so I feel that its now time to give up and ask for some help since it seems that I am obvisouly missing something... all I want to do is having a form with a dropdown menu. When the user select a value from the drop down and sumit the value, this value must be the new ''active_client''. Technicaly, when the
2006 May 06
6
assert_raises --> how does it work?
Hi, I have this code fragment: def test_delete_concept assert_not_nil Concept.find(concepts(:entreprise).id) get :delete_concept, {:concept_id => concepts(:entreprise).id} assert_raises :RecordNotFound, Concept.find(concepts(:entreprise).id) end basicaly, on the first line, I make sure that the concept exist in the DB. On the second line I delete the concept fron the DB.