Displaying 20 results from an estimated 200 matches similar to: "modalbox rails var interpolation"
2010 Jul 01
6
Close Modalpopup with RJS
hi guys:
I''m scratching my head on this one: I have a twitter app where I''m
trying to open a modalpopup with a twitter sign in, get them to sign in,
then close the popup and refresh the main window. My code however
refreshes the main window with the popup window result, which I thought
was really strange:
application.html.erb
function OpenModalPopUP()
{
2009 Aug 26
5
Noob DRY method question
Hi Gurus, I''m learning the Rails framework, and I have this exact
block of html/javascript in two places in an if/else construct in
application.html.erb:
<body onload="Modalbox.show(''<div class=\''warning\''> <p> <center> <%=
flash[ :notice ] %> </center> </p> <p> <center> <input
2007 May 25
1
form_remote_tag :condition
I am using the following validation prototype-based js library:
http://tetlaw.id.au/view/javascript/really-easy-field-validation
What I am trying to do is upon submitting a form via AJAX, I want it
to meet the conditions of the validation of the function validateMe()
If it passes, go ahead and continue and push the form information via
an AJAX call. This is what I have:
<% form_remote_tag
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
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?
2009 May 25
4
after_create and has_one association bug?
Hello,
I''ve come across an issue that I''m sure is a bug when using after_create
with a has_one association, but I''m not 100% certain if I''m missing
something.
This is pretty much exactly the code I''m using. Two simple classes
(Account and Contact) and I create the contact after I create an account
(via after_create). I''m not passing in a
2009 May 27
12
query on Ruby array
Looking for suggestions on following two queries.
Query 1
------------------------------
Are the two following lines of code different in Ruby / Rails ( in a
*.html.erb) file.
<% if @forms.count != 0 %> <!-- first code -->
Vs.
<% if @forms.count %> <!--second code -->
@forms is an array of objects. Coming from "C" language development
background, i thought
2010 May 05
6
form remote tag :before=> function problem
Hi I have a strange problem, I am using the below code
form_remote_tag :url => ''/abc/test'',:before => "return hello();",
:update=>''test_categories'' ,:complete => "Element.hide(''spinner'')",
:loading => "Element.show(''spinner'')" do
I am using :before=> function to validate the
2009 May 25
1
Passing a JavaScript variable through a Rails params hash
Hi guys, hoping someone can give me a pointer with this?
I have a Javascript variable that I''m updating dynamically as a user
interacts with the page. I want the user to be able to save it''s value
at any time along with some text data in a pop-up form, so the best way
I can think of is to pass it through the params hash without writing it
into the form. I''m not totally
2008 Apr 07
7
Saving attribute
Something is getting lost here.
def create
@home = Team.find_by_user_id(current_user.id)
for player in @home.players
player.update_attribute(:game_id, @game.id)
end
end
def show
@players = Player.find_all_by_game_id(params[:id])
end
view
<%= @players.size %> # mistakenly equals zero
Played with the console and everything should be working fine...
2009 May 27
9
Contingent Select Boxes - 2 Q's
I have a form with contingent select boxes (the state is contingent on
the country selected, so when the country selected changes, the state
changes -- I am using the Carmen plugin for getting my state names and
country names together, but not the functionality I am interested in
achieving).
Everything works fine except I cannot figure out how to amend my code
such that:
A. When the form is first
2008 Apr 15
4
ActiveRecord::StatementInvalid in BlogController#index
Hello. I''m trying to do the video tutorial "how to build a blog engine
in 15 minutes with ruby on rails" from the main rubyonrails website,
and I''m getting an error when I try to use scaffold :post after
editing my config file for the mysql database.
Here is the exact error I''m getting:
ActiveRecord::StatementInvalid in BlogController#index
2010 Apr 14
4
module/class question
Are these two below the same thing?
1. module X
module Y
class Z
2. class X::Y::Z
--
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
2008 Apr 02
9
Problem getting the most recent has_many associated object
I can''t get my view to display the most recent parameters from an
associated object in a view... here is a birds-eye of my app:
I have two models, Ferms and Kinetics. Ferm has_many :kinetics,
Kinetic belongs_to :ferm. Kinetic has the fields ferm_id, brix and
temp.
In my ferms/index view I have a table listing the attributes of each
ferm instance. I would like to display the most recent
2009 May 25
2
CAn u please tell wats the prob in runnning my project?
[~/kallori]# rake db:migrate
(in /home/gm/kallori)
no such file to load -- hmac-sha1
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require''
/home/gm/kallori/vendor/rails/activesupport/lib/active_support/
dependencies.rb:510:in `require''
2009 May 24
6
belongs_to not saving foreign key
Under Rails 2.3.2 using a completely brand new project, I have 2
models:
class Author < ActiveRecord::Base
# name:string
end
class Book < ActiveRecord::Base
# title:string
belongs_to :author # author_id
end
And a simple test where i create a Book with an Author using the
belongs_to and then update the foreign key directly:
require ''test_helper''
class BookTest
2009 Feb 05
1
Need the activerecord-sqlserver-adapter but...
Hi... I am new to RoR development, and Web development in general (but
have about 25 years of IT/software experience - just not in the Web
area)... I have a really good RoR 2.X book that I have read and reread a
few times and starting to try to apply what I read... Have a Web app
that I need to write at work, and prove to folks that RoR is THE_WAY,
despite their ASP .NET protests otherwise...
So,
2009 Feb 15
2
Collapsible Fieldset
Hey there,
(First steps in Ruby and Rails...)
I''m trying to make a fieldset collapsible, like they are, for example,
on many Drupal pages.
What I''ve figuared out is the following:
<fieldset id="addressdata" class="collapsible collapsed">
<legend>
<%= link_to_function("Show/Hide Addressdata") { |page| page[:
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