similar to: Ruby variable that embeds html tags

Displaying 20 results from an estimated 4000 matches similar to: "Ruby variable that embeds html tags"

2010 Nov 05
9
[patch] Let's use <%== %> instead of <%= raw() %>
I''ve submitted a small patch to make Rails behave properly with the Erubis <%== %> construct. For some reason the current behaviour of that tag in Rails 3 is to escape the contents _twice_ which is probably a bug. I offer three suggestions why this is a good idea: - The syntax is cleaner. It can avoid a lot of .html_safe and raw in your views. I especially like the conciseness of
2010 May 17
6
Should an blank string be html_safe?
Just trying to implement a simple helper over the past few days had me really confused. messages = '''' messages << content_tag(:p, ''dave'') #=> &lt;p&gt;dave&lt;\p%;gt; Eventually I realised the original empty string was not html_safe message = ''''.html_safe message << content_tag(:p, ''dave'') #=>
2006 Feb 06
1
Check, and display, AIM status on rails page
Thought I''d post this in case it''s of use to anyone. Maybe even a recipe? It''s just some simple helpers to show AIM status on a webpage. I searched before coding it, and didn''t find anything similar. Maybe that''s because it was so simple :) These methods belong in a helper (such as app/helpers/application_helper.rb) # begin AIM helper methods def
2009 Sep 12
3
Cannot get my password to validate
Hello, I am working through the railsspace tutorrial, and i''ve noticed that the password validation is no longer working. I can get screen_name and email to validate, but for some reason, the password field is ignored... here''s what i have so far: within user.rb file PASSWORD_MIN_LENGTH = 4 PASSWORD_MAX_LENGTH = 40 validates_length_of :password, :within =>
2010 Jul 31
4
Exception: can't dup Symbol
Hey everybody, I''m trying to test a little piece of code I wrote, and I get the following error: Exception: can''t dup Symbol It happens in the following line: try_to_login @valid_user, :remember_me => "1", where the function try_to_login is: def try_to_login(user, options = {}) user_hash = {:screen_name => user.screen_name, :password => user.password}
2006 Mar 25
7
Overriding <div class="fieldWithErrors">
Does anyone know how to override the <div class="fieldWithErrors"> behaviour when a form field is incorrect? Thanks, Dan
2011 Jan 24
11
Can't get login to work
Hi, could anybody help me try to get a login function working, I have created a database for users called user1, I have the login screen set up but when i hit login with a correct username and password, nothing happens I am expecting the lgin button to direct the user to the main page and show the user as logged on, but nothing happens! Thanks! Controller class User1Controller <
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file. class UserControllerTest < ActionController::TestCase fixtures :users def setup @controller = UserController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @invalid_user = user(:invalid_user) @valid_user = users(:valid_user) end def test_login_success
2010 Aug 14
10
Redirecting after logging in
Hey everybody, I''m trying to make an example of a small networking site, and when I log in a user, it should redirect and show his profile, but I get the following error: NoMethodError in User#index Showing app/views/user/index.html.erb where line #5 raised: undefined method `screen_name'' for nil:NilClass Extracted source (around line #5): 2: Your basic information 3:
2007 Dec 06
2
passing parameters through link_to
Is it possible to pass parameters through link_to that will be used by the controller that link_to directs to? Specifically I have this code: <% for user in @users -%> <%= link_to user.screen_name, {:action => "index", :controller => "users", :user_id => user.id } %> <% end %> Is it possible to use the parameter at the end of link_to(:user_id
2008 Jul 07
3
How to get a users screen name into a hidden field in a PostsController action?
Instead of the user entering a name, I want to pass their screen name along with supplied :title and :content fields. here is what I''ve got.. f.hidden_field :author, user.screen_name here is the create method from Posts controller: def create @title = "Gravity" @user = User.find(params[:id]) # this does not work, and I don''t know why if request.post?
2010 May 26
3
Safebuffer with rails 2.3.8
Hi there! I''ve just migrated from rails 2.3.5 to 2.3.8 and now I have a lot (and I mean a lot!) of deprecation warnings like this one: "DEPRECATION WARNING: ActionView::SafeBuffer is deprecated! Use ActiveSupport::SafeBuffer instead." But I don''t understand how to remove this. I searched through installed plugins, and there is no reference to SafeBuffer :( Any
2012 Apr 25
8
showing error (gsub) when switching from session to cookies
I am newbie to rail. Trying to develop social networking site so working with railspace application. Everything is working fine but I stuck in the problem when i am giving the authorization tocken to the user to remember him/her. My Error and controller code is below Error:- private method `gsub'' called for 4:Fixnum C:/Users/Amir/Downloads/IR/ruby/lib/ruby/1.8/cgi.rb:342:in
2005 Feb 28
5
Using session data in model
Hi, I want to use my some session data when I validate som data in the model. The specific problem I have is that I present different forms data based on gender, and then dependent of the gender, there''s different fields that needs validation. I''m wondering what''s the preffered way of doing this. The session data is not present in the model, i.e: class Myclass
2018 Aug 28
2
IceCast - Is it still being developed?
Hello! I was just wondering if the IceCast platform was still being actively developed? Thank you, Jason -- _DEFINE YOUR DESTINY IN ULTIMA GENESIS: CALL OF THE AVATAR [1]! PLAY FOR FREE TODAY._  FOLLOW US ON SOCIAL MEDIA! [2] [3] Links: ------ [1] https://titanx.games [2] https://www.facebook.com/titanxgames/ [3] https://twitter.com/intent/user?screen_name=_TitanXGames --------------
2010 Sep 19
4
Rails 2.3.8 - InvalidAuthenticityToken problem. URGENT!
I used to have Simple Captcha installed, but since I removed it I got all kinds of problems with login. Processing UsersController#login (for 188.177.122.179 at 2010-09-19 12:21:09) [POST] Parameters: {"commit"=>"OK", "authenticity_token"=>"/ Y0aZETCsMhyI3CkrZJK6O2NaLEoi+LRe8ZuDPWU9kc=",
2008 May 04
5
simple Routing Error
Routing Error No route matches "/user/register" with {:method=>:get} The URL is http://localhost:3000/user/register Here is app/views/user/register.rhtml <h2>Register</h2> <% form_for :user do |form| %> <fieldset> <legend>Enter Your Details</legend> <div class="form_row"> <label
2020 Jul 21
2
error al instalar glue
Hola, Estoy haciendo un análisis de datos de Twitter y cuando intento correr esta línea de código: timelines %>% dplyr::filter(created_at > "2020-01-01") %>% dplyr::group_by(screen_name) %>% ts_plot("days", trim = 1L) + ggplot2::geom_point() + ggplot2::labs( title = "Tuits publicados por cada cuenta" ) Me da el siguiente error Error in
2018 Aug 29
2
IceCast - Is it still being developed?
Is this the version of "Karl Heyes" with extra features? If not, there can I find the "Karl Heyes"-version? Am 28.08.2018 um 23:05 schrieb jake: > > https://gitlab.xiph.org/xiph/icecast-server/commits/master > > The last commit was a week ago, and it looks fairly active, so.... yes? > > On 2018-08-29 05:28, Chernabog wrote: > >> Hello! I was just
2011 Feb 09
16
rails 3.0.4 broke yield :javascript ?
hello, I have today updated my rails app to 3.0.4 security release but now this yield :javascripts fails in the layout and I get my custom js escaped as text in the view. anybody seeing this also? tia, jk -- www.least-significant-bit.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to