similar to: RJS behave differently than render :partial?

Displaying 20 results from an estimated 500 matches similar to: "RJS behave differently than render :partial?"

2006 Apr 26
3
drop downs
I''m having trouble getting a second drop down populated based on the value from the first drop down. I''ve tried following some of the examples posted, but haven''t had any success. I''m new to RoR so any help would be appreciated. When the first drop down''s value gets changed, it calls the correct method in the controller and even finds the correct
2006 Jun 09
0
partials and rjs
I must have a misunderstanding of partials, maybe one of you can help me out. I have a page that initially displayed via the following: <-- in controller --> def find_areas_for_country @country_areas = CountryArea.find(:all, :conditions => ["country_id = :country", params], :order => "descr asc") render :partial => ''country_area''
2006 Jun 15
0
return from controller not evaluating script
I am using this in my controller to reload the country_area partial in my form def add_country_area render :update do |page| page[:country_area].reload end end << in form >> <span id="country_area"> <%= render :partial => ''country_area'' %> </span>&nbsp; << partial _country_area.rhtml >>
2010 Mar 26
7
seed data
Hi I am using seed_fu to seed initial data to tables (http://github.com/mbleigh/seed-fu) . And in db/fixtures/state.rb I have values like (I am filling only two data for simplicity) State.seed_many(:name, :abbr,:fips,:country_id, [ { :name => "Alberta", :abbr => ''AB'',:fips => ''01'', :country_id => 2 }, { :name =>
2007 Nov 07
5
Unexplainable failure...at least for me
I have an address model with country_id and province_id fields There is also a full_address method that returns an address that is in a format that the google maps api will be able to return a long-lat coords. Within the full_address method there is a call to obtain the province/state and country name. --------- def full_address ... full_address = [city, self.province.name,
2012 May 28
4
How to load a selection list into the method new of a controller?
Hi friends! I''m relatively new with Rails and I''m struggling for a long time with this problem (it should have a pattern solution but until now I didn''t find it): I have the following models: Institution, City, State and Country. class Country < ActiveRecord::Base has_many :states has_many :cities, :through => :states end # == Schema Information # Table
2006 Apr 06
0
3 doubts on observe_field
Dear friends, with the yours aid already I obtained to use observe_field, but still I am with some problems and necessary again. They are three questions to long of the source code below. Since already I am grateful for the tips. ==== _form.rhtml <!--[form:city]--> <p><label for="city_state_country_id">Pa?s</label><br/> <select
2010 Nov 09
2
Undefined method
I am very new to ROR. (Ruby 1.8.7, rails 2.1.1, rack 0.8.7, mysql 5.1.41) I has my_app/lib/migration_helpers.rb file: module MigrationHelpers def self.foreign_key(from_table, from_column, to_table) constraint_name = "fk_#{from_table}_#{to_table}" execute %{alter table #{from_table} add constraint #{constraint_name} foreign key (#{from_column})
2009 Jan 28
3
Apply style in collection_select ?????
Hi to all, i have this snip i want to apply style to this combo but there is no effect help....... <%= collection_select(:customer,:country_id, @countries,:id, :country, html_options={ "style" => "width:110px" },:onchange => ''updateState('''');'',:id =>''country_id'' )%> Thanks, -- Posted via
2006 Jul 02
1
multitable form
Hi all, Although I''m experienced with programming I''m a beginner with ruby, RoR and MVC So I follow examples from books and so on and all is ok. I can make a model who is a class and who match to a table in my database and then I generate pretty forms on a webpage. I would like to know how I can do to make forms who interact with more than one table. For an example lets
2006 Jul 28
3
Forms: handle foreign keys (AssociationTypeMismatch)
Hi all I tried and tried and tried, but I still fail in creating a form with proper validation and stuff for foreign keys... So I''d really like to get some help here. I''m creating a booking site for DJ''s, and for every booking one can choose one of different countries: class Booking < ActiveRecord::Base validates_presence_of :country_id
2005 Dec 17
17
problems with quotes and escaping
First of all I''d like to say thanks for all the great work everyone has put into scriptaculous, I''m having a lot of fun playing with the framework, and easily moving into Web 2.0 territory. I''ve just hit a snag on my project though. So here''s my code: ... var newEvent= "<div
2012 Nov 18
0
How mix jquery based ui packages and ruby on rails
I am trying to use jqx ui that is based on jquqery I have following questions 1. How do I generate the right id and name for the element without setting the element name and id in the format model name [attribute] ? Example <%= f.text_field :country_id %> generates sets the element id and name to bank[country_id] 2.how do i set the form element attributes like action ? Do i just use
2006 Mar 18
10
collection_select''s linked
I created a form with two collection_select, country and state and would like to bring up to date the state list when to select a new country. How I can make this in Rails? Thanks Eleudson Brazil <p><label for="person_country_id">Country</label><br/> <%= collection_select(:person, :country_id, @countries, :id, :name) %></p> <p><label
2013 Jan 04
1
plm random effect: the estimated variance of the individual effect is negative
Matteo, I fully agree with David: please read the posting guide. Anyway, the error message says it all: "the estimated variance of the individual effect is negative". See e.g. the "basic panel" chapter (10 or 11) in Wooldridge's "Econometric Analysis of XS and Panel Data" to understand why this may happen. Stata's behaviour is (as far as I remember) to
2012 Nov 17
2
Help needed for error in foreign key validation
I have two models bank and country. User should only associate a Bank with a country id present in the country table and I put validates presence of country to enforce it but i get error mysql2::Error: Unknown column ''countries.bank_id'' in ''where clause'': SELECT `countries`.* FROM `countries` WHERE `countries`.`bank_id` = 17 LIMIT 1 when updating the bank
2012 Dec 29
2
I need intercept in plm model
Hi,R 2.15.2 plm() function on Windows 7 when i perform a plm regression, i can't manage to obtain the intercept, but I need it.it gives me just the beta coefficient. my formula: fixed <- plm(deltaS ~ L1.deltaS + L2.deltaS, data=Mody_R, index=c("country_id", "date"), model="within") my output: Coefficients : Estimate Std. Error t-value Pr(>|t|)
2007 Mar 20
2
collection_select - why doesn't it work?
Hi all I guess this is quite a newbie question, but I''m just stuck here and don''t know why. <%= form.collection_select :origin_country, Country.find(:all), :id, :name %> gives me a select list with name="member[origin_country]". When submitting the form the following error is shown: Country expected, got String When I try <%= form.collection_select
2006 Sep 06
1
Changing Scaffold
Hi, I am starting a project in rails and I wish to change scaffolding. I''ve already done some changes like prepare all texts for locale. Now I am wishing to change the way it generates the _form partial. Could someone give some guideline so I can study such thing? I saw "template_for_inclusion" in form.rhtml but couldn''t find out how to change it. Being more
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: <%