Displaying 3 results from an estimated 3 matches for "statescontroller".
2005 Apr 27
3
caches_page questions
...have run into a couple questions:
1) The site has ''states'' (as in U.S. states), so I have a State model
and a States controller. Going to http://sitename/states/ routes you to
the States controller, ''index'' action. The States controller looks like so:
class StatesController < ApplicationController
caches_page :index, :list, :show
def index
list
render_action ''list''
end
def list
@page_title = ''States''
@states = State.find_all
end
[..snip...]
end
If I load the page, I get the following in the log:
Ren...
2012 May 28
4
How to load a selection list into the method new of a controller?
...es.each do |s| %>
<tr>
<td><%= s.sigla %></td>
<td><%= s.nome %></td>
<td><%= button_to ''Selecionar'', institution_selstate_path( s ) %></td>
</tr>
<% end %>
</table>
class StatesController < ApplicationController
def index
@states = State.where(''nome != ?'', ''desconhecido'').order(:nome)
end
class InstitutionsController < ApplicationController
def new
@institution = Institution.new
if session[:state_id].nil?
session[:st...
2008 Jul 17
2
Problem with link_to_remote, RJS and jRails
...e,
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 render the default template, in my case a RJS
template
end
2. here''s the whole update_view.rjs file:
page.insert_html :bottom, ''result_view'', "Hello, World!<br/>"
3. inside show.html....