Displaying 20 results from an estimated 1000 matches similar to: "How to add link_to_remote element with RJS?"
2005 Jun 29
4
Problem connecting to MySQL
Hello, when I invoke an action of my rails web app I recieve this message:
No such file or directory - /tmp/mysql.sock
In my MySQL config file I have this line:
socket=/var/lib/mysql/mysql.sock
Why Rails doesn''t pick up this value instead of his default value?
How could I change the configuration of Rails in order to change that value?
--
/ Eduardo Yáñez Parareda /
2010 Dec 30
6
validates_inclusion_of doesn't match constant
Hello, I have a model Model:
SPECIAL_FEATURES = %w(none top)
class Model
validates_inclusion_of :special_feature, :in =>
Model::SPECIAL_FEATURES,
:on => :create, :message => "special_feature
%s is not defined"
belongs_to :team
def special_feature
attributes = attributes_before_type_cast
if attributes["special_feature"]
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute?
<div id="new_item_details" style="display:none"></div>
<%= link_to_function("Show details...", nil, :id => "show_details") do
|page|
page.visual_effect(:toggle_blind, :new_item_details)
if (page[:new_item_details].style.visibility ==
2006 Jul 13
6
Migrations + foreign keys
Hi all,
In the AWDR author use the execute method to declare foreign keys:
execute "alter table.... add constraint.... foreign key...."
Is there a ruby sintax to declare a foreign key in a migration class?
--
Posted via http://www.ruby-forum.com/.
2008 Jul 23
0
Link_to_remote object missing
Hello, I''m in troubles trying to use ''link_to_remote'' on Rails 2.1.
Having this page:
<h4>Editing project</h4>
<% form_for(:project, :url => project_path(@project), :html =>
{ :method => :put }) do |f| %>
<p>
Name <%= f.text_field :name %>
Date <%= calendar_date_select :project, :target_date, :time =>
2006 Aug 14
2
Another try with REST
I''m using edge rails.
My routes.rb is:
map.connect '':controller/service.wsdl'', :action => ''wsdl''
# Install the default route as the lowest priority.
map.connect '':controller/:action/:id''
map.resources :team <---- THIS LINE ADDED BY ME
Also have a team_controller.rb, a team.rb model and scaffolding for it.
If I
2006 Mar 14
7
Starting with RJS - not working
Hi,
I''m trying to work with RJS and folowed Cody Fauser''s tutorial
(http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates)
I''ve started by creating a new rails applications and executing
rake freeze_edge
rake rails:update:javascripts
rake rails:update:scripts
After that I''ve created a controller:
class DtestController < ApplicationController
2005 Jun 23
6
Problems with Hello World
Hello, I''m installed RubyOnRails in my Fedora Core 4 system.
I''ve created an empty web application with:
rails cookbook
then a controller
ruby script/generate controller MyTest
And a file named my_test_controller.rb was created at
cookbook/app/controller directory.
I ''ve written a new method for MyTestController class like:
def index
render_text "Hello
2006 Jul 13
4
Regenerate DB
Hi again :),
I''m playing with migrations. I''ve created some migrations classes and
with
rake db:migrate the tables are created and altered fine, but then I
dropped
some of the tables and when I run db:migrate command again I don''t get
tables
being re-created.
What am I doing wrong? Is there a way to run db:migration in order to
drop the
tables?
--
Posted via
2008 Jul 04
4
Libs directory
Hello,
I had an application on Rails 1.2 or 1.1 (don''t remember). Now I have
updated it to 2.1.
I had a migrations_helper.rb in the Libs directory which defined
foreign_key and drop_foreign_key methods. But now migrate task doesn''t
find them. Have I to include this directory somewhere with Rails 2.1?
Doesn''t it work as always?
Could I use another thing to declare
2008 Jan 27
4
(REST) Nested routes
Hello, I''m in troubles with nested routes. I have three models: Team,
Tournament and TeamTournaments
class Team < ActiveRecord::Base
has_many :tournaments, :through => :team_tournaments
has_many :team_tournaments
class TeamTournament < ActiveRecord::Base
belongs_to :team, :foreign_key => ''team_id''
belongs_to :tournament, :class_name =>
2006 Aug 01
1
SimplyRestful
Hi, Is it SimplyRestful compatible with Rails 1.1.4 or Would I need edge
Rails?
--
Posted via http://www.ruby-forum.com/.
2006 Aug 11
2
Some questions of REST actions
I''ve set up my application to use edge rails in order to get REST
functionality.
I''ve a controller called team (team_controller.rb) with some actions
(index, list,
show, create, new....). Moreover in routes.rb I''ve added
map.resources :team
so I guess I could call
localhost:3000/xxxx/team/1
or
localhost:3000/xxxx/team/1;edit
Well, when I do the first call, server
2007 Mar 08
3
Problem loading data from database
Hello, I get this error trying to load some data from DB. I''m using
Rails 1.2.2 on Fedora Core 6 and Sybase adapter.
This worked fine when application run under Rails 1.1.6 but now I''m
migrating to 1.2.2 and have some problems.
At browser I got:
SQL Command for table_structure for tplib_bckps failed
Message: schema_info not found. Specify owner.objectname or use
sp_help to
2008 Jul 17
2
Problem with link_to_remote, RJS and jRails
Hi, everyone,
I''m trying to update the content of a div using link_to_remote and RJS
template.
Everything works fine if I use the default Prototype/Scriptaculous
libraries, but I want to use jRails ''coz other parts of my application
use a lot of jQuery.
Here are the steps I done:
1. inside StatesController.rb I defined the following action:
def update_view
# do nothing just
2006 Nov 28
8
view specs with partials
When I first learned about the View specs I was very excited. I
still am. However, I haven''t found them useful yet for one reason.
They throw the following exception when ever a view renders another
view, which is very common.
ActionView::TemplateError in ''Event View message''
No rhtml, rxml, rjs or delegate template found for spec/rails/
view_spec/_info
2008 Mar 31
10
Problems with *_path() and *_url() helpers when using Publisher
Hello,
I am running into issues using *_path() and *_url() helpers the
Facebooker Publisher framework. I encounter the following error when
using these helpers while *inside of a partial*:
undefined method `default_url_options'' for ActionView::Base:Class
I''ve seen a few other people speak about this issue, yet I haven''t
seen any resolution on the mailing list yet.
2006 Apr 05
2
RJS and remote forms
I''ve run into what I think is a browser bug related to using
remote_forms pushed in an RJS update.
In my controller, I have an action that creates a new model and returns
a form for one of its children:
def create_party
party = Party.create
render :update do |page|
page.insert_html :top, ''party-list'', :partial => ''party_header'',
2006 May 28
1
RJS template / page.insert_html problem
Hiall,
I have a rjs template which is calling page[:xxx].replace_html ... a
couple of times and this works perfectly. However, in the same rjs
file I have two calls to page.insert_html, which do not work. No error
in development.log, nor error message in browser, the new content for
the div simply isn''t changed at all.
This is my code:
...
action = "save_" +
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a
list of projects:
page.replace_html ''results'', ''<div>''
@projects.each do |p|
page.insert_html :bottom, ''results'', p.name + "<br/>"
end
page.insert_html :bottom, ''searchresults'', ''</div>''
page.show