Displaying 20 results from an estimated 20000 matches similar to: "Ajax/View Best Practices"
2006 Apr 04
3
Forms, view & AJAX best practice help
What i''m trying to get working is I have a controller called
"permissions" and a view "permissions.rhtml". This view has a hidden div
that contains a form for adding new roles. Its just a single textfield.
Also on the page I have a dropdown list of roles and then underneath
that a div that contains a list of permissions for the role selected in
the dropdown. I
2008 Dec 21
1
Form issues : partials + AJAX vs simple JS / separate views + form_fors vs one view and fields_fors
Hi all!
I am coding an application that keeps track of request to create
college courses. An identified user (logically a faculty member)
completes a form indicating the name of the course, the professor in
charge, the course''s code, the date and place, the possible
coprofessors and TAs and the type of website he or she wants to use as
a teaching help (WebCT, Sakai, etc.).
I have two
2006 Feb 14
2
Inline list editing with RJS: best practices
I wanted to get the community opinion on the best way to use partials and
inline list (<li>) editing.
I have a very common scenario where a list is rendered:
--- index.rhtml ---
<ul>
<%= render :partial => ''item'', @collection => @items %>
</ul>
--- _item.rhtml (simplified) ---
<li id="item_<%= item.id %>">
<div
2006 Feb 14
0
Best practices for handling associations in ctrlrs/views
Forgive me if this topic has come up before. I''m new to Rails (from a
Java background, with a good deal of Perl as well.) I''m very much
attracted to the idea of having an integrated MVC stack, and from what I
see, Rails is "the right thing."
To set up my question, here''s some background. In an app I am building,
there are three models:
an item has many
2010 Nov 16
4
view.should render_template best practices?
I''ve been looking for the definitive answer for months now, and the
RSpec book doesn''t touch on it at all:
How do we now handle stubbing out rendering of partials in view specs
in RSpec2?
I have a large (35K+ lines of views and related specs) that I''m trying
to upgrade to Rails3/RSpec2. My views use partials pretty extensively
and this issue is a huge blocker for me.
2013 Sep 19
0
CRUD model in a bootstrap modal with jquery, ajax - best practice
Hi,
i have an model, which i want to show edit and update in a dialog via ajax.
What i do at the moment:
To open the Modal and render the partial, i send an ajax request to
controller#show with ujs
this is the link:
<a class="person-dialog" data-remote="true" data-type="script"
href="/en/people/32" onclick="return false">Fidel
2006 Jul 24
8
Views in one controller reaching out to other controllers (best practices)
Hello all. For the purpose of my question, let''s imagine we''re building some
search functionality.
You''re a sales person (you poor sap). And you''re hanging out in the
SalesCenterController. You need to do a search for available productions;
you''ve decided to be cool and use Ajax. Do you...
a) Make a remote call to an action in your current controller
2006 Aug 30
0
Saving lots of editable data - best practices?
All,
In my app., I am displaying the contents of a spreadsheet that the user
uploads in a XLS/CSV file (thanks parseexcel & fasterCSV!), and then
saving it into tables internally. I would like to make this data
editable in my app. in a spreadsheet-like display.
I am trying to think about the best way to handle the data update to the
server.
Here are my thoughts. I am looking for
2006 Mar 08
4
ajax with tables
There may be an easy solution, but I just can''t seem to get this to work...
I''m using tables for part of my site, as they contain a lot of rows and
columns full of financial data, so just working with div''s and dd''s... etc,
won''t do.
My table structure is pretty simple, as follows:
=================
<table id="items">
<tr>
2006 Jul 17
3
Best practices - field initialization based on display rules
All,
I have a form with the following field interaction rules.
Given checkbox A,
text field B
text field C
If checkbox A is checked then make text field C equal to the value of
text field B and disable field C.
If checkbox A is unchecked then enable field C.
In order to display a form where I''m manipulating an already existing
object, I have something like this in my RHTML template
2006 Feb 14
4
Escaping the AJAX View
I have a login form, in which I use a "form_remote_tag".
I''m redirecting users to this form when they fail authentication as well...
and using the "jumpto" method of capturing they
original URL they requested via request.parameters, and redirecting to this
URL after they authenticate.
Problem is, if I try to do a "redirect_to", this won''t work, as
2006 Apr 05
1
New AJAX function: remote_replace_with_partial() <-- write less code
I hate writing controller actions that support simple lightweight
ajax calls like this:
def show_buttons
render :partial => "home_buttons"
end
So the birth of remote_replace_with_partial
Now you can replace a div elements with any controllers partials and
pass those partials any number of params without having to write
supportive actions in your controllers. This is a great
2006 Apr 25
5
to ajax or not to ajax
before I started building my latest rails app, I made the decision to make
good use of ajax. My reasonsing was that users would benefit from the
quicker page updates - the application provides various different types of
insurance quotes, and has several multi-page forms and reports that can be
drilled down 5 or 6 levels deep in some cases - so it seemed like a good
candidate for ajax
Now
2008 Apr 15
4
Best practice for showing ajax loader gif?
what is the best practice for showing animated ajax spinner?
The usual Element.show(''spinner'') has to stick with every form''s
:loading. Is there some easier or light-weight method?
Because I have this page that can contain upto 100 forms. And with all
of those would be 100 hidden spinners.
Please suggest something.
--
Posted via http://www.ruby-forum.com/.
2008 Mar 13
4
AJAX slow - to_json responsible?
Hello.
I am building full-ajax back-end, which consits of many quite big
partials. As the system grows up, performance is problem. After every
click, partial is refreshed, if needed. I am now at 0.5 sec / request. I
tried to simply disable ajax and the result was quite suprising: the
same page is rendered over 2x faster. I update 80% of page in case of
ajax. (Please dont tell: dont use ajax when
2011 Mar 15
0
what is the best coding practices for Rails (model View Controller )?
Hi all
please share ur exp
what is the best coding practices for Rails (model View Controller )?
Please specify the topic which u want to give like
if you want to give points about Model
Than specify it.
Thanks and regards,
Shyam
ruby on rails developer
Mobile : +91(0)86-8846-8400
Web : Shyam.heroku.com <http://shyam.heroku.com/>
--
You received this message because you are subscribed
2011 Jan 06
1
View specs - best practices
Howdy,
I''m trying to test some mailer views (which is no different to normal
views in terms of specs)... ran into the following problem...
In adherence to the "one expectation per ''spec''"... I''m trying to
write the following
describe "auth/mailer/signup.html.erb" do
before(:each) do
@user = Factory.build(:user)
assign(:user,
2006 May 25
5
Is there a way to abstract the updating of other parts of the page after an Ajax request without putting using the standard view file?
Hey all,
I''d like to abstract the process of updating different portions of the
page after an Ajax request has taken place. Rather than simply putting
the extra view logic in the standard rjs template, it seems to give
better separation if there is a split between the core view logic (ie,
inserting a row in a table), and updating any associated portions of
the page.
Is this possible? I
2012 May 21
4
Rendering partial views with ajax calls in rails 3.1
I''m starting now with rails, and i have simply question i think.
I need to render two partials in one ajax call:
I have the following controller:
# GET /hosts/1
# GET /hosts/1.json
def show
@host = Host.find(params[:id])
respond_to do |format|
format.html #show.html
format.js
format.json { render :json => @host }
end
2005 Dec 21
3
How to make a drop-down automatically submit an AJAX form
Hi,
I know that to make a dropdown box automatically submit when you change
the value, you do this:
<select ..... onchange="this.form.submit();">
BUT i''ve got an ajax form, and if i do the above trick, it simply
reloads the ajax partial into the whole screen, rather than into the div
where it is meant to go.
I''ve already got it all working so that if you click