2

我对 RoR 真的很陌生,但我一直认为学习语言的最佳方法是先跳入头脑。我正在努力在 RoR 中创建一个生成报告的 webapp。到目前为止我的进展:

轨道新项目

光盘项目

rails 生成脚手架数据库 League_Name:string Logo_URL:string Event_URL:string Website:string Facebook:string Twitter:string Youtube:string Funding:string Owner:string Phone:string Email:string Other:string Attendence:string Events_per_Year:string Locations:string Rules :string How_to_Enter:string Notable_Streamers:string Event_Titles:string Background:text game1_title:string game1_genre:string game1_website:string game1_years_played:string game1_prize_pool:string game1_prize_awarded:string game1_live:string game1_transmitted:string game1_method:string game1_advance_entry:string game1_invitational:string game1_contestants_open:string game1_contestants_finals:string game1_bracket_open:string game1_bracket_finals:string game1_rules:text game2_title:string game2_genre:string game2_website:string game2_years_played:string game2_prize_pool:string game2_prize_awarded:string game2_live:string game2_transmitted:string game2_method:string game2_advance_entry:string game2_invitational:string game2_contestants_open:string game2_contestants_finals:string game2_bracket_open:string game2_bracket_finals:string game2_rules:text game3_title:string game3_genre:string game3_website:string game3_years_ward3 :string game3_live:string game3_transmitted:string game3_method:string game3_advance_entry:string game3_invitational:string game3_contestants_open:string game3_contestants_finals:string game3_bracket_open:string game3_bracket_finals:string game3_rules:text game4_title:string game4_genre:string game4_website:string game4_years_played:string game_awarded_pool: game4_live:string game4_transmitted:string game4_method:字符串 game4_advance_entry:字符串 game4_invitational:字符串 game4_contestants_open:字符串 game4_contestants_finals:字符串 game4_bracket_open:字符串 game4_bracket_finals:字符串 game4_rules:文本

耙分贝:迁移

我已经在展示架上进行了一些 CSS 重新格式化,这部分进展顺利。从长远来看,我想输入我的所有数据,当我点击显示时,它会返回如下内容:

https://docs.google.com/spreadsheet/ccc?key=0AsOtsP63Kb2mdFpKZFZ6OV9PQmVWUU9Qc1FzV2UtVGc

这一切都很好;但是,有时 facebook twitter 等网站的 URL 比我的格式允许的 <td> 更长,并且文本只是拖尾。我进行了一些搜索,发现一些网站说可以使用 bitly 服务创建更短的 URL。这些网站对于初学者来说非常模糊。

http://coryschires.com/how-to-shorten-urls-with-bit-ly-in-ruby-on-rails/

似乎在我想要的正确轨道上,但我不知道如何制作

<tr>
<td class="td1">Website:</td>
<td><%= @database.Website %></td>
</tr>
<tr>
<td class="td1">Facebook:</td>
<td><%= @database.Facebook %></td>
</tr>
<tr>
<td class="td1">Twitter:</td>
<td><%= @database.Twitter %></td>
</tr>
<tr>
<td class="td1">Youtube:</td>
<td><%= @database.Youtube %></td>
</tr>

生成 URL 的 bit.ly 版本。而且我不明白如何将他的例子应用到我的工作中。

4

0 回答 0