Forum: Rails-ES pasar una variable

Posted by Karla Guzman (k_liliana)
on 2010-04-30 18:56
mi codigo es el siguiente

<h1>Welcome</h1>

<% if logged_in? %>
@aja=<%= current_user.login %>
  <p><strong>You are logged in as <%=h current_user.login
%></strong></p>
  <p><%= link_to 'Logout', logout_path %></p>
  <%= link_to "Mantenimiento", { :controller => "mantenimiento" }%>
  <%= link_to "Modulo de Ventas", { :controller => "venta" }%><br/>
<% else %>
  <p><strong>You are currently not logged in.</strong></p>
  <p>
    <%= link_to 'Login', login_path %> or
    <%= link_to 'Sign Up', signup_path %>
  </p>
<% end %>


quiero pasar <%=h current_user.login %> al controller de venta.
alguien podria decirme como

Muchas Gracias.
Posted by Cristian Vasquez (heavyblade)
on 2010-05-01 00:26
Karla Guzman wrote:
> mi codigo es el siguiente
> 
> <h1>Welcome</h1>
> 
> <% if logged_in? %>
> @aja=<%= current_user.login %>
>   <p><strong>You are logged in as <%=h current_user.login
> %></strong></p>
>   <p><%= link_to 'Logout', logout_path %></p>
>   <%= link_to "Mantenimiento", { :controller => "mantenimiento" }%>
>   <%= link_to "Modulo de Ventas", { :controller => "venta" }%><br/>
> <% else %>
>   <p><strong>You are currently not logged in.</strong></p>
>   <p>
>     <%= link_to 'Login', login_path %> or
>     <%= link_to 'Sign Up', signup_path %>
>   </p>
> <% end %>
> 
> 
> quiero pasar <%=h current_user.login %> al controller de venta.
> alguien podria decirme como
> 
> Muchas Gracias.

Dedusco que esta utilizando Authologic o un plugin similar y seguramente 
current_user es un Helper y por lo tanto puedes utilizarlo en el 
controllador

Saludos,
Posted by Karla Guzman (k_liliana)
on 2010-05-01 00:34
> 
> Dedusco que esta utilizando Authologic o un plugin similar y seguramente 
> current_user es un Helper y por lo tanto puedes utilizarlo en el 
> controllador
> 
> Saludos,

ASi es Muchisimas Gracias.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.