Stream

Join this community to post or comment

Dave Aronson

News & Cool Stuff  - 
 
I've just added some basic spam protection to my EOTS (Email Of The Species) Rails gem! Details are in the "Accepting the Filled-In Form" paragraph of the README at https://github.com/davearonson/eots/. For now it just raises an uncaught error -- later I will probably have it say something intelligible, in case a non-spammer triggers it.
1
Add a comment...

Mathew O'Hare

Looking for help...  - 
 
I'm trying to add a dynamic style attribute to an element, but the Rails render engine is encoding the quote marks around the style's value. It does this with single or double quotes.

The controller code is:
@hshAmach[:note1style] = 'style=\'background-color: darkred;\''

The ERB code is:
<div class='toolbtnnotify' <%= render(:text => @hshAmach[:note1style]) %>>
[<%= @hshAmach[:note2] %>]
</div>

And it makes:
<div class='toolbtnnotify' style=&#x27;background-color: darkred;&#x27;>
[2]
</div>

How does one do it to produce single or double quotes instead of the encoding. The browser isn't taking the encoded quotes as quotes.
1
Mathew O'Hare's profile photoChris John's profile photo
4 comments
 
Rails, starting in version 3, defaults to encoding all output to avoid attacks. If you want the raw output, use the 'raw' helper function or mark the string as 'html_safe'. By marking the string as html_safe, it will not be processed by the sanitizer.
Add a comment...

Andrey Karpov

News & Cool Stuff  - 
Which programming language to start learning? Python or Ruby? Which one is better? Django or Ruby on Rails? Such questions can often be found on IT forums around the world
1
1
Add a comment...

Netasha Adams

Discussion & Meta  - 
 
Create Your Customized Application!

#Ruby #WebDevelopment #RubyonRails #Application #RubyonRailsDubai
Imgur: The most awesome images on the Internet.
1
Add a comment...

John Mayo

Looking for help...  - 
 
Hello Rails community,
Watching Railscasts and other forums I've figured out how to scrape sites like grabbing retail prices or text, using nokogiri and mechanize gems . What is not clear to me his how to grab elements from a format like an external CSV file. For example I have a utility sensor that records kilowatt hour usage as CSV but no headers are included, only the data in KWH, hours, date etc with commas as delimiters. I'd like to scrape the csv, save it and use the data to create a graph or chart. I've tried import.io but it does not recognize the file format. I think nokogiri and mechanize require specific css selectors which the file does not have. The file is not on the main page but can be accessed via a dropdown list that you click which takes you to the file. So far I've only tried to scrape directly from the file specific url ( import.io, nokogiri) but maybe I have to crawl through the dropdown first? I don't know enough Rails to know whats best approach. Thank you for your help!
1
Jeff Lunt's profile photoJohn Mayo's profile photo
4 comments
 
Nope, I built my first scrape barely a week ago using nokogiri and mechanize. I read about how to store the data locally in csv format but somehow I've missed the where and how to parse externally? I'm still learning alot about Rails, thanks for the guidance.

Add a comment...

Michal Szymanski

News & Cool Stuff  - 
 
Hello,

we have published a series of free tutorials about Bootstrap 4 and Material Design.

They have recently become very popular, so perhaps some of you finds it useful.

Your feedback is very welcome.
Learn to create responsive, stunning websites and apps.
14
1
Add a comment...

Peter Blake

Discussion & Meta  - 
 
Hi, is there any web mail client for RoR or Sinatra? what would you recommend?
1
Add a comment...

Panayotis Matsinopoulos

Looking for help...  - 
 
How can I demonstrate the PRG pattern (Post/Redirect/Get) pattern using a demo Rails application?

I remember that, once, I was able to demonstrate the RPG pattern using a Rails application and a standard browser like Chrome or Firefox. Now, I am not able to do that. And I do not know why.

I am creating the application so that when the POST request (for an update) succeeds I am not redirecting but I am rendering the edit view again. Then I am hitting the <Ctrl+R> or <F5> on my browser and the page just sends a GET instead of a POST request with the form data. I was expecting a warning question like "Are you sure that you want to resubmit form data" and, on confirmation, a POST request sent back to server with same form data.

Has anything changed in browsers with regards to how they handle the refresh button?

If yes, is there any way I can demonstrate this pattern. Is this pattern still valuable to follow on backend?

Update: I now see that this works as I expect it with Safari. So, I still believe it is a Chrome/Firefox handling behaviour.
1
Add a comment...

Maximiliano Garcia

Looking for help...  - 
 
Hi I'm using Rails 5 ActionCable, i need to create a client outside the Rails App, more specifically in an AngularJs client. Any ideas on how to do that? All the examples and tutorials are build on top of the Rails App.
1
Add a comment...

Gustavo Ariel Yarros

Discussion & Meta  - 
 
Sorry for my English....

Good'm creating a modal popup to materialize, I need to know how to pass the client id for example for the upload form ....
so I call the modal window

%a.waves-effect.waves-light.btn.modal-trigger.btn-floating{:href => "#editar_cliente", :id_cliente => client.id }
.....
.....
.....
#editar_cliente.modal
.modal-content
@client= Client.find(***ID***)
= render 'edit'
.....
.....
.....
1
Add a comment...

Nishant Modak

Discussion & Meta  - 
 
Resilient microservices. Options? A bulkhead is an upright wall within the hull of a ship which serves to limit the failure within the compartment.
1
Add a comment...

About this community

Rails, with a focus on technical news and cool articles from the people in the community. Certain types of posts tend to be off-topic for this community: > Job postings or solicitation of work > "X vs. Y" posts such as "Ruby vs <insert language>" - community members are generally able to judge for themselves, and these types of posts often start flame wars for no reason > Advertisements for commercial services > Links with referral codes (esp. where the poster stands to benefit) > Repeat usage of the community for self-promotion > Posts from an organization, rather than an individual > Posts that are about more general programming topics, and are specific neither to Ruby, nor Rails

jesus castello

News & Cool Stuff  - 
 
A video tutorial I made for you all. Let me know what you think :)
How can you create a set of data that is always unique? Learn how in this video tutorial.
1
Add a comment...

Prashant Mishra

Looking for help...  - 
 
Hi, I want to integrate payu payment gateway with solidus framework, but I don't have any idea how to do that. I found some gem like 'payuindia', 'payu' and spree_payu_integration but I am confused how to add payu in payment methods. If anyone have done same please help me out.
Thanks.
1
Prashant Mishra's profile photo
 
Is there nobody who can help me?
Add a comment...

Muhammad Waqas

Discussion & Meta  - 
 
Smooth Sail When Using Ruby On Rails!
#RubyOnRails #Ruby #WebDev #OpenSource #RubyonRailsDubai
It is important to identify the overall value proposition of a technological tool. As technology has developed now you look for a tool that can solve almost every piece of the puzzle. For programmers new tools have made things easier to comprehend and implement. Why utilize a new tool when you ...
1
Add a comment...

Yasser Shah

Discussion & Meta  - 
 
Live Development of LCTV's Community Website using Ruby on Rails https://www.livecoding.tv/bill-auger/
1
Add a comment...

Christian Rolle

News & Cool Stuff  - 
 
A positive attitude towards life and a positive coding style in #Ruby .
1
Add a comment...

Tanay Sharma

Looking for help...  - 
 
How to get access token for creating dataset in Power BI through REST API from Rails APP ?

Currently I have only client_id and client_secret ,what other parameter do I need for creating dataset
1
Add a comment...

Luis Alfredo Soto Zorrilla

Looking for help...  - 
 
hi . i'm new in rails, im trying to install a gem pg but i get this error.
1
Fabio Bazurto's profile photoLuis Alfredo Soto Zorrilla's profile photo
5 comments
 
i solved running CMD as administrator, like you talk to me in the past coment
Add a comment...

AMRINDER SINGH

News & Cool Stuff  - 
 
Integrating #Paypal In #Rails Application (Part-1).

http://goo.gl/AKtdQB

#RubyOnRails
2
1
Add a comment...

Abramov Aleksei

Looking for help...  - 
 
Dhaivat Pandya takes you on a tour of Artoo, a Ruby-based platform aimed at making working with embedded systems and Ruby a breeze. Boop Beep Boop!
1
Add a comment...