Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

SLB Conseils's Profile

GitHub User: lbstephane


Comments by SLB Conseils


I did it like this

confirm: t("sure")

but in fact my question is more for links like the one below :

<%= link_to (raw('<button class="btn" rel="tooltip" title="Edit"><i class="icol-pencil"></i></button>')), edit_user_path(user)%> 

It works like a charm :) Thank you very much !

Just a question, how can I use I18n in javascript confirmation, for example to delete an item

<%= link_to raw(''), user, confirm: 'Are you sure?', method: :delete %>

Thanks :)


Hi, nice episode, very helpful.

But (there is always a but lol) i have a problem ! (2 in fact)

I'm using ruby 3.2.11

if I try to use in my routes.rb :

scope module: :v1, constraints: 1) do

I have an error message 'No route matches [GET] "/dev/v1/media"', if I use a namespace instead (but without constraints) it works! Any idea ? (my first namespace is dev not api)

Other problem, I specified the json format by default in my namespace, set the respond_to :json in my controller but if I use respond_with, got a error message "Missing Template", I need to use :

@media = Medium.all
              respond_to do |format|
                format.json { render json: @media, status: :created }

Any idea ?

Thanks :)


I use the gem s3_direct_upload inspirated by the code, but I have a problem.

Upload and progress bar works perfectly, my problem is :

The url of the uploaded file is a part a a Medium I create. The Medium contain "name", "description", "file_url" etc.

I don't display the S3 form at the creation of my medium, after saving, I redirect_to the Edit action and then display the S3 form to add a file. I tried to set post:media_url(@medium) or post:medium_edit_path(@medium) but it doesn't work cos I guess update require PUT and not POST.

So, is it possible to implement PUT with the gem or may I do something different ?

Thanks for your help


Ok adding group_ids as attr_accessible in my User Model solve the problem !

Sorry :p


Thanks for this great screencast.

Got an issue with my app.

Checkboxes well diplayed, but when I update, got a message "Can't mass-assign protected attributes: group_ids"

So, I try to manage membership.

Got users and groups.

membership model :

class Membership < ActiveRecord::Base
  attr_accessible :created_at, :group_id, :position, :user_id
  belongs_to :group
  belongs_to :user

User model :

  attr_accessible :client_id, :email, :firstname, :group_id, :lastname, :password, :password_confirmation, :role_id
  has_many :memberships
  has_many :groups, :through => :memberships

Group model

  attr_accessible :name, :client_id, :description, :user_id
  has_many :memberships
  has_many :users, :through => :memberships

Here the code in my form

<%= hidden_field_tag "user[group_ids][]", nil %>
  <% Group.all.each do |group| %>
          <%= check_box_tag "user[group_ids][]",, @user.group_ids.include?(, id: dom_id(group) %>
          <%= label_tag dom_id(group), %><br>
  <% end %>

Did I miss something ?



It seems the error is generated by the line has_secure_password

My Gemfile is OK, don't understand :(

Edit : Ok, it works, I installed brypt-ruby before, so I needed to update my bundle and restart my server !


Got this error on signup
undefined methodkey?' for nil:NilClass`

Any idea ?