I currently have two workarounds in my rails app :
The first, and I think the most simple :
I'm unable to get links for controllers made with script/generate
controllers. I made an "index" controllers, and a "news" method in it.
I'd like to link_to like : <li><%= link_to 'News', news_index_path %></
but it don't work. What I'm missing here ?
The second : I have a form for players to login. I get a dangerous
glitch : it add user in database instead of logging.
Here's the code :
<% form_for(@Player) do |f| %>
<%= f.error_messages %>
<%= f.text_field :name %>
<%= f.text_field :password %>
<%= f.submit "Login" %>
<% end %>
[login in index.html.erb]
@Player = Player.new
@Player = Player.new(params[:player])
#logged_in_user = @Player.try_to_login
flash[:notice] = "Utilisateur invalide"
[methods in player's model]
def self.login (name, password)
find(:first, :conditions => ["name = ? and password = ?", name,
Once again, what I'm missing here ?
Any help is apprecied.